-
Notifications
You must be signed in to change notification settings - Fork 3
net link layer
Data link access, responsible for access and data transfer through physical medium
Defines the transport unit: frame and mechanism of send/receive.
Consists of two components: Logical Link Control (LLC) and Media Access Control (MAC)
Layer 2 implementations: Ethernet, WiFi, Token Ring, PPP
- divides the data into frames
- provides addressing
- provides medium access
- differs depending on layer 1
Non hierarchinal, flat, 6 Bytes. Address types:
- unicast
- multicast
01:...
(lsb of most significant byte eqal to 1) - broadcast
FF:FF:FF:FF:FF:FF
First 3 Bytes denote NIC producent
Ethernet protocol governing data transmission.
Each host monitors the medium. If the medium is busy then no transmission happens.
If the medium is free, wait IFG (inter frame gap) time and begin transmission. Between every two frames there is at least IFG idle time. Since multiple hosts may detect that the medium is free, they may start transmission simultaneously causing collision.
If the collision is detected, apply to all colliding hosts
- finish sending preamble (if applies)
- send jam sequence (32 bits)
- stop sending
- backoff
- retry send
In Ethernet segment the collision can't occur after sending 64B
In order to calculate Ethernet segment size, following assumptions are made:
- the Ethernet frame cannot be send without guarantee that no collision occurs.
- minimal frame size is 64B
- time to send minimal frame is called the time slot
- the time slot must be sufficiently long to: detect collision and send jam sequence in the maximum-sized network segment
Time to send minimal frame is 51.2 us in 10Mb/s Ethernet network
Packet travels roughly 2/3 c time ~= 200 000 km/s
In order to find maximum allowed segment size:
- assume that collision occurs at the farthest point
- the host at that point immediately detects collision and sends the jam sequence
- the jam sequence must reach the sender within slot time and within same time the sender must receive it:
51.2us == 2(propagation time) + jam sequence send time + jam sequence receive time
Assume thatjam sequence send time
==jam sequence receive time
== 9.6us (longer than sole jam sequence)
The propagation time becomes: 16us and given propagation speed of 2/3 c the maximum theoretical size is 3.2km.
In reality due to intermediate equipment it is less than 3.2km
- retransmission
- gathering data from MAC
- error detection
preamble (8B) | destination address (6B) | source address (6B) | Type (2B) | Data (46B-1500B) | Frame Sequence Check (2B) |
---|---|---|---|---|---|
- | - | - | 0800 - IPv4, 08100 - 802.1q | zero padded if less than 46B | CRC |
- General
- OS
- Networks
- Configuration
- Protocols
- Link layer
- Sockets
- Routing
- Tunneling
- Debugging
- LoRa
- Virtualization
- Infrastructure as a code
- Desktop environments
- Monitoring
- Benchmarking