Introduction To OSI 7 Layer Model and Data Link Layer in Detail
Introduction To OSI 7 Layer Model and Data Link Layer in Detail
Introduction To OSI 7 Layer Model and Data Link Layer in Detail
Some terminology:
link
hosts and routers are nodes communication channels that connect adjacent nodes along communication path are links
wired links wireless links LANs
link
Deals with communication between adjacent nodes joined by a physical(LAN wire, WIFI, Bluetooth) link.
transportation analogy
trip from kanyakumari to delhi ship: kanyakumari to chennai plane: chennai to mumbai train: mumbai to delhi
tourist = datagram transport segment = communication link transportation mode = link layer protocol travel agent = routing
Error Detection:
errors caused by signal attenuation, noise. receiver detects presence of errors:
signals sender for retransmission or drops frame (used in fiber optics and wired networks) Error Correction:
receiver identifies and corrects bit error(s) without resorting to retransmission (used in wifi)
Adaptors Communicating
datagram sending node frame adapter link layer protocol frame adapter
sending side:
encapsulates datagram in a frame adds error checking bits, flow control, etc.
receiving side
looks for errors, flow control, etc extracts datagram, passes to receiving node
One of the Methods of Starting and ending flags with bit stuffing Framingbit pattern (flag byte) Each frame begins and ends with a special
01111110 Whenever the senders data link layer encounters five consecutive ones in the data it automatically stuffs a zero bit into the outgoing bit stream
Thus if the receiver looses track of where it is all it has to do is to scan input for flag sequences since they can only occur at frame boundaries and never within the data.
Reliable delivery
The outgoing frames are numbered and the receiver sends an acknowledgement for that particular frame So the sender knows which frames the receiver has received. Sender knows which frame to send again and which shouldnt be sent again. This ensures the reliable delivery of the data
Flow control
Sender wants to send fast than the capacity of the receiver. The frames might be lost in this case Feedback based flow control Receiver sends back information to sender giving it permission to send more data For example when a connection is setup the receiver might say you may send me n frames now but after they have been sent do not send any more until I have told you to continue
Error Detection
EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction
Parity Checking
Single Bit Parity:
Detect single bit errors
Goal: detect errors (e.g., flipped bits) in transmitted segment (note: used at transport layer only) Receiver: Sender:
treat segment contents as sequence of 16-bit integers checksum: addition (1s complement sum) of segment contents sender puts checksum value into UDP checksum field
compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later .
view data bits, D, as a binary number choose r+1 bit pattern (generator function), G goal: choose r CRC bits, R, such that
<D+R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero remainder: error detected!
CRC Example
D = 101110 Add r = 000 after D (for purpose of division only) G= 1001 Remainder R = 011 Add remainder R to D D+R = 101110(011) This bitpattern is divisible by generator function and so will be error
= adapter
0C-C4-11-6F-E3-98
Each IP node (Host, Router) on LAN has ARP table ARP Table: IP/MAC address mappings for some LAN nodes
< IP address; MAC address; TTL>
LAN
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98 237.196.7.88
TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed
ARP is plug-andplay:
nodes create their ARP tables without intervention from net administrator
A creates datagram with source A, destination B A uses ARP to get Rs MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram As adapter sends frame Rs adapter receives frame R extracts IP datagram from Ethernet frame, sees its destined to B R uses ARP to get Bs MAC address R creates frame containing A-to-B IP datagram sends to B
A R
Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used to synchronize receiver, sender clock rates
Type: indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk) CRC: checked at receiver, if error is detected, the frame is simply dropped
5: DataLink Layer