data link layer Flashcards
what are some services that the datalink layer provides
framing
reliable delivery between adjacent nodes
flow control
error detection and correction
full and half duplex
framing
encapsulating datagrams from the network layer into a frame and adding a header and trailer
MAC address
added in the frame header
id the source and destination of each hop
how are mac addresses portable
when you change networks you dont need a new one
ARQ; automatic repeat request
asks the previous hop to resend the packet if theres an error
flow control
the pacing between adjacent sending and receiving hops
half-duplex
both the sender and receiver cant transmit data at the same time
how is the link layer implemented
on a network interface card
what is the NIC a combination of
firmware; software thats hardware specific
software; the kernel has modules for the link layer
hardware; the nic
ep roam
non volatile memory that stores firmware
what does the edc include
could be the entire frame including the header or just the data
what does the node do if theres too much corruption compared to if theres only a little
too much; asks to resend
little; corrects and sends
parity bit
single bit that detects single errors
with even parity you set the bit so theres an even amount of 1s
how do we alter parity bit to correct errors and how does this work
use two-dimensional parity
theres a parity bit for each row and column
when an error is detected the intersection of the row and column shows which bit it is which can then be flipped to correct it
what is an issue with 2-d parity
can only detect one error per row(odd number of errors )
what are two issues with regular parity bit
only detect an odd number of errors
doesnt correct
what effects do a larger edc have
better edc however decreases the efficiency of data throughput
cycle redundancy check(crc)
uses field theory to compute semi unique values for a given message
why does crc only compute semi-unique values
depends on d and g and some values may have the same remainder
what type of errors does crc detect
single and duplicate
errors with odd bit numbers
what happens on the sender side of crc
add r 0s to the data bits
divide the new sequence by g using binary division and get the remainder
transmit the originial data followed by the computed remainder(crc)
what happens on the receiver side of crc
divide the transmitted sequence by g
if the remainder is 0 then there are no errors
what is the generator value in crc
r + 1
what are the 2 types of multiple access links
point-to-point
shared broadcast
multiple access protocol
a distributed algorithm that determined how nodes share a channel
collision
when two or more nodes transmit simultaneously and their signals interfere with each other
distributed algorithm
a protocol that determines how and when each node can transmit on a shared channel to avoid collisions
what are two mac protocols
channel partitioning
random access
channel partitioning
dividing the channel into smaller pieces and allocating each one to a node
tdma; time division multiple access
each node gets a fixed time slot which is when the node can send data if its available
what is the issue with tdma
not efficient as unused slots go idle
fdma; frequency division multiple access
the channel is divided into different frequency bands and each node gets assigned one where they can transmit data at any time
what is the issue with fdma
lacks efficiency as a band is wasted if a device is not ready to transmit
what are the two channel partitioning protocols
tdma
fdma
random access protocols
channels arent divided and allow collisions but can recover from them
what are some principles of sorted ALOHA
all frames are the same size and time slots are divided equally
code is transmitted at the beginning of the time slot
the nodes are synchronised and if 2 or more nodes transmit at the same time they detect the collision
in ALOHA how are nodes able to detect a collision
nodes can hear their own signal so if they hear one that isnt them then they know that theres a collision
how does ALOHA work
when a node gets a fresh frame it transmits in the next slot
if theres no collision then it can send a new frame in the next slot
if there is a collision then the node either backs off or re transmits until the frame goes through based on an algorithm
what is a negative of aloha
theres a lot of collision and wasted resources
37% max efficiency
simple csma; carrier sense multiple access
listens before transmission
if channel is empty then transmits entire frame
if busy then defer transmission
csma/cd; with collision detection
when a collision is detected then the node backs off for a certain amount of time
if its repeated then the time to back off increases
collisions are detected within a short amount of time which reduces the amount of time wasted on them
how does an nic detect a collision
comparing the signal theyre transmitting with the signal theyre receiving on the network
what does the nic do when it detects another transmission whilst sending
sends a jam
why do we need mac addresses
to avoid the os being interrupted by packets not intended for it which it would have to constantly drop
what is a mac address
like an id that is unique to each device and mobile
48bit address burned into the rom that allows you to send frames on the lan/subnet
what is address resolution protocol(arp)
determined the mac address of a given ip address
each host has an arp for the subnet that its on with each mapping having a ttl
why do mappings in the arp table have a ttl
hosts are mobile and ip addresses can change
what happens during address resolution protocol
the host broadcasts the arp query containing the ip of the mac address it wants
each host receives the broadcast and if its own ip is in the message then it replies directly to the query with its mac address
the mapping is then added to the arp table
how do we route to another subnet when we need the mac address of the destination
a knows b ip, and the gateway router ip and mac via dchp and arp
a creates a datagram with source a and destination b and encapsulates it in a link layer frame with the gateway router mac as the ip
the router receives the frame and the datagram is removed and the ip layer uses the forwarding table to find out the interface that the packet should be passed out from based on the destination ip
the router then creates a new frame with the source mac being itself and the destination being b mac with the ip datagram still unchanged within it
when the frame reaches b it extracts the ip datagram and processes it
why are there no collisions when using ethernet
each link is running a different ethernet protocol
ethernet as connectionless
no handshake required
ethernet as unreliable
no acknowledgements are sent
ethernet switch as transparent
has no mac address so transparent to hosts
why do ethernet switches not need to be configured
they’re self learning
what does an ethernet switch do when two hosts are transmitting simultaneously to the same destination
the switch puts them in order then sends them one at a time to avoid a collision
what is preamble in the ethernet header and how does it work
the first 8 bytes are used to sync the sender and receiver clocks
the first 7 bytes are 10101010 and the last one is 10101011
when the receiver reads the last one then it knows that the next byte is actual data
type in ethernet header
indicates a higher level protocol usually ip
used to demultiplex at the receiver end
crc in the ethernet header
used for error detection
how does the ethernet switch forward and filter frames
they are self learning so they learn which hosts can be reached through which interfaces via observing packets
when a switch receives a frame it adds the source mac and the interface it came from to its forwarding table
it then looks at the destination mac and check if its in the table
if its there and the destination is on the same part as the frame then its dropped as its redundant to send it back otherwise its forwarded to the port
if there’s no entry then the switch floods the frame to all interfaces except the one it came from ensuring that the frame reaches the destination