Your SlideShare is downloading. ×
0
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Introduction to the OSI 7 layer model and Data Link Layer

8,073

Published on

Published in: Education, Technology
2 Comments
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
8,073
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
336
Comments
2
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. Introduction to OSI 7 layer model and Data Link Layer in Detail VNIT ACM Student Chapter - Mustaqim Moulavi
  2. Introduction to Number system <ul><li>Binary number system </li></ul>
  3. Introduction to Number system <ul><li>Hexadecimal number system </li></ul><ul><li>0000 = 0 = (0) 10 </li></ul><ul><li>0001 = 1 = (1) 10 </li></ul><ul><li>0010 = 2 </li></ul><ul><li>. </li></ul><ul><li>1010 = A = (10) 10 </li></ul><ul><li>. </li></ul><ul><li>1110 = E = (14) 10 </li></ul><ul><li>1111 = F = (15) 10 </li></ul>
  4. 7 Layer OSI Model of Networking Architecture <ul><li>ISO/ Open System Interconnection Reference Model </li></ul><ul><li>It divides network </li></ul><ul><li>architecture into seven </li></ul><ul><li>layers which, from top </li></ul><ul><li>to bottom </li></ul><ul><li>A layer is a collection of conceptually similar functions that provide services to the layer above it and receives service from the layer below it. </li></ul>
  5. 7 Layer OSI Model of Networking Architecture <ul><ul><li>Outlines WHAT needs to be done to send data from one computer to another. </li></ul></ul><ul><ul><li>Each layer Provides services to the layer above it </li></ul></ul><ul><ul><li>And gets services </li></ul></ul><ul><ul><li>From layer below it </li></ul></ul><ul><ul><li>You can see it like </li></ul></ul><ul><ul><li>Each layer is customer </li></ul></ul><ul><ul><li>Of the layer below it </li></ul></ul><ul><ul><li>And provides services to </li></ul></ul><ul><ul><li>Layer above it </li></ul></ul>
  6. 7 Layer OSI Model of Networking Architecture What each layer does?
  7. Remembering the 7 Layers <ul><li>7 - A pplication A ll </li></ul><ul><li>6 - P resentation P eople </li></ul><ul><li>5 - S ession S eem </li></ul><ul><li>4 - T ransport T o </li></ul><ul><li>3 - N etwork N eed </li></ul><ul><li>2 - D ata Link D ata </li></ul><ul><li>1 - P hysical P rocessing </li></ul>
  8. Topics for today’s seminar <ul><li>Data Link Layer in Detail in 3 parts </li></ul><ul><li>The Basic Design principles for Layer 2 i.e. Link Layer communication between only 2 nodes and dealing with problems </li></ul><ul><li>Working of Real networks - Ethernet (LAN) system at the Link Layer level </li></ul><ul><li>Wireshark Demo showing the actual live data flowing in the network in the form of packets, decoding them and understanding what all this data packets means.* </li></ul>
  9. Some terminology: <ul><li>hosts and routers are nodes </li></ul><ul><li>communication channels that connect adjacent nodes along communication path are links </li></ul><ul><ul><li>wired links </li></ul></ul><ul><ul><li>wireless links </li></ul></ul><ul><ul><li>LANs </li></ul></ul><ul><li>layer-2 packet is a frame , encapsulates datagram </li></ul>“ link”
  10. What is link layer? <ul><li>data-link layer has responsibility of transferring datagram from one node to adjacent node over a link </li></ul><ul><li>Deals with communication between adjacent nodes joined by a physical(LAN wire, WIFI, Bluetooth) link. </li></ul>“ link”
  11. Link layer: context <ul><li>Datagram transferred by different link protocols over different links: </li></ul><ul><ul><li>e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link </li></ul></ul><ul><li>Each link protocol provides different services </li></ul><ul><ul><li>e.g., may or may not provide rdt over link </li></ul></ul><ul><li>transportation analogy </li></ul><ul><li>trip from kanyakumari to delhi </li></ul><ul><ul><li>ship: kanyakumari to chennai </li></ul></ul><ul><ul><li>plane: chennai to mumbai </li></ul></ul><ul><ul><li>train: mumbai to delhi </li></ul></ul><ul><li>tourist = datagram </li></ul><ul><li>transport segment = communication link </li></ul><ul><li>transportation mode = link layer protocol </li></ul><ul><li>travel agent = routing algorithm </li></ul>
  12. Why data link layer is required? <ul><li>The data sent in the physical layer is in the form of 0 and 1. physical layer doesn't understand what it means. </li></ul><ul><li>It is like 2 blind persons communicating with only 2 words YES and NO. </li></ul><ul><li>No one knows where a sentence starts and where it ends and what it means. </li></ul><ul><li>Moreover Communication circuits make errors occasionally. </li></ul><ul><li>The function of the link layer is to provide error free communication and make some meaning out of the data sent/receieved. </li></ul>
  13. Specific functions of the link layer <ul><li>The task of data link layer is to convert the raw bit stream offered by the physical layer into a stream of frames for use by the network layer </li></ul><ul><li>Providing reliable service to the layer above it i.e. network layer </li></ul><ul><li>Dealing with transmission errors. </li></ul><ul><li>Regulating the flow of data so that slow receivers are not swamped by fast senders </li></ul>
  14. Link Layer Services <ul><li>Framing, link access: </li></ul><ul><ul><li>encapsulate datagram into frame, adding header, trailer </li></ul></ul><ul><ul><li>channel access if shared medium </li></ul></ul><ul><ul><li>“ MAC” addresses used in frame headers to identify source, dest </li></ul></ul><ul><ul><ul><li>different from IP address! </li></ul></ul></ul><ul><li>Reliable delivery between adjacent nodes </li></ul><ul><ul><li>seldom used on low bit error link (fiber, some twisted pair) </li></ul></ul><ul><ul><li>wireless links: high error rates </li></ul></ul><ul><ul><ul><li>Q: why both link-level and end-end reliability? </li></ul></ul></ul>
  15. Link Layer Services (more) <ul><li>Flow Control: </li></ul><ul><ul><li>pacing between adjacent sending and receiving nodes </li></ul></ul><ul><li>Error Detection : </li></ul><ul><ul><li>errors caused by signal attenuation, noise. </li></ul></ul><ul><ul><li>receiver detects presence of errors: </li></ul></ul><ul><ul><ul><li>signals sender for retransmission or drops frame (used in fiber optics and wired networks) </li></ul></ul></ul><ul><li>Error Correction: </li></ul><ul><ul><li>receiver identifies and corrects bit error(s) without resorting to retransmission (used in wifi) </li></ul></ul>
  16. Adaptors Communicating <ul><li>sending side: </li></ul><ul><ul><li>encapsulates datagram in a frame </li></ul></ul><ul><ul><li>adds error checking bits, flow control, etc. </li></ul></ul><ul><li>receiving side </li></ul><ul><ul><li>looks for errors, flow control, etc </li></ul></ul><ul><ul><li>extracts datagram, passes to receiving node </li></ul></ul>sending node datagram adapter adapter link layer protocol frame frame
  17. One of the Methods of Framing <ul><li>Starting and ending flags with bit stuffing </li></ul><ul><li>Each frame begins and ends with a special bit pattern (flag byte) 01111110 </li></ul><ul><li>Whenever the senders data link layer encounters five consecutive ones in the data it automatically stuffs a zero bit into the outgoing bit stream </li></ul>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.
  18. Reliable delivery <ul><li>The outgoing frames are numbered and the receiver sends an acknowledgement for that particular frame </li></ul><ul><li>So the sender knows which frames the receiver has received. </li></ul><ul><li>Sender knows which frame to send again and which shouldn’t be sent again. </li></ul><ul><li>This ensures the reliable delivery of the data </li></ul>
  19. Flow control <ul><li>Sender wants to send fast than the capacity of the receiver. </li></ul><ul><li>The frames might be lost in this case </li></ul><ul><li>Feedback based flow control </li></ul><ul><li>Receiver sends back information to sender giving it permission to send more data </li></ul><ul><li>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” </li></ul>
  20. Error Detection <ul><li>EDC= Error Detection and Correction bits (redundancy) </li></ul><ul><li>D = Data protected by error checking, may include header fields </li></ul><ul><li>Error detection not 100% reliable! </li></ul><ul><ul><li>protocol may miss some errors, but rarely </li></ul></ul><ul><ul><li>larger EDC field yields better detection and correction </li></ul></ul>
  21. Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity : Detect and correct single bit errors Chances are 50:50
  22. <ul><li>Sender: </li></ul><ul><li>treat segment contents as sequence of 16-bit integers </li></ul><ul><li>checksum: addition (1’s complement sum) of segment contents </li></ul><ul><li>sender puts checksum value into UDP checksum field </li></ul><ul><li>Receiver: </li></ul><ul><li>compute checksum of received segment </li></ul><ul><li>check if computed checksum equals checksum field value: </li></ul><ul><ul><li>NO - error detected </li></ul></ul><ul><ul><li>YES - no error detected. But maybe errors nonetheless? More later …. </li></ul></ul>Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: used at transport layer only )
  23. Checksumming: Cyclic Redundancy Check used at link layer <ul><li>view data bits, D , as a binary number </li></ul><ul><li>choose r+1 bit pattern (generator function), G </li></ul><ul><li>goal: choose r CRC bits, R , such that </li></ul><ul><ul><li><D+R> exactly divisible by G (modulo 2) </li></ul></ul><ul><ul><li>receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! </li></ul></ul><ul><li>widely used in practice </li></ul>
  24. CRC Example <ul><li>D = 101110 </li></ul><ul><li>Add r = 000 after D (for purpose of division only) </li></ul><ul><li>G= 1001 </li></ul><ul><li>Remainder R = 011 </li></ul><ul><li>Add remainder R to D </li></ul><ul><li>D+R = 101110(011) </li></ul><ul><li>This bitpattern is divisible by generator function and so will be error free </li></ul><ul><li>IEEE 802 G function = 1000001001100000010001110110110111 </li></ul>
  25. Working of Ethernet MAC Addresses and ARP <ul><li>32-bit IP address: </li></ul><ul><ul><li>network-layer address </li></ul></ul><ul><ul><li>used to get datagram to destination IP subnet </li></ul></ul><ul><li>MAC (or LAN or physical or Ethernet) address: </li></ul><ul><ul><li>used to get datagram from one interface to another physically-connected interface (same network) </li></ul></ul><ul><ul><li>48 bit MAC address (for most LANs) burned in the adapter ROM </li></ul></ul>
  26. LAN Addresses and ARP Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless)
  27. LAN Address (more) <ul><li>MAC address allocation administered by IEEE </li></ul><ul><li>manufacturer buys portion of MAC address space (to assure uniqueness) </li></ul><ul><li>Analogy: </li></ul><ul><li>(a) MAC address: like Social Security Number </li></ul><ul><li>(b) IP address: like postal address </li></ul><ul><li>MAC flat address (no hierarchy) ➜ portability </li></ul><ul><ul><li>can move LAN card from one LAN to another </li></ul></ul><ul><li>IP hierarchical address NOT portable </li></ul><ul><ul><li>depends on IP subnet to which node is attached </li></ul></ul>
  28. ARP: Address Resolution Protocol <ul><li>Each IP node (Host, Router) on LAN has ARP table </li></ul><ul><li>ARP Table: IP/MAC address mappings for some LAN nodes </li></ul><ul><li>< IP address; MAC address; TTL> </li></ul><ul><ul><li>TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) </li></ul></ul>1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 237.196.7.23 237.196.7.78 237.196.7.14 237.196.7.88 Question: how to determine MAC address of B knowing B’s IP address?
  29. ARP protocol: Same LAN (network) <ul><li>A wants to send datagram to B, and B’s MAC address not in A’s ARP table. </li></ul><ul><li>A broadcasts ARP query packet, containing B's IP address </li></ul><ul><ul><li>Dest MAC address = FF-FF-FF-FF-FF-FF </li></ul></ul><ul><ul><li>all machines on LAN receive ARP query </li></ul></ul><ul><li>B receives ARP packet, replies to A with its (B's) MAC address </li></ul><ul><ul><li>frame sent to A’s MAC address (unicast) </li></ul></ul><ul><li>A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) </li></ul><ul><ul><li>soft state: information that times out (goes away) unless refreshed </li></ul></ul><ul><li>ARP is “plug-and-play”: </li></ul><ul><ul><li>nodes create their ARP tables without intervention from net administrator </li></ul></ul>
  30. Routing to another LAN <ul><li>send datagram from A to B via R </li></ul><ul><li>assume A know’s B IP address </li></ul><ul><li>In routing table at source Host, find router 111.111.111.110 </li></ul><ul><li>Two ARP tables in router R, one for each IP network (LAN) </li></ul><ul><li>In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc </li></ul>A R B
  31. <ul><li>A creates datagram with source A, destination B </li></ul><ul><li>A uses ARP to get R’s MAC address for 111.111.111.110 </li></ul><ul><li>A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram </li></ul><ul><li>A’s adapter sends frame </li></ul><ul><li>R’s adapter receives frame </li></ul><ul><li>R extracts IP datagram from Ethernet frame, sees its destined to B </li></ul><ul><li>R uses ARP to get B’s MAC address </li></ul><ul><li>R creates frame containing A-to-B IP datagram sends to B </li></ul>A R B
  32. Ethernet Frame Structure <ul><li>Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame </li></ul><ul><li>Preamble: </li></ul><ul><li>7 bytes with pattern 10101010 followed by one byte with pattern 10101011 </li></ul><ul><li>used to synchronize receiver, sender clock rates </li></ul>
  33. Ethernet Frame Structure (more) <ul><li>Addresses: 6 bytes </li></ul><ul><ul><li>if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to net-layer protocol </li></ul></ul><ul><ul><li>otherwise, adapter discards frame </li></ul></ul><ul><li>Type: indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk) </li></ul><ul><li>CRC: checked at receiver, if error is detected, the frame is simply dropped </li></ul>5: DataLink Layer
  34. Wireshark Demo to see Ethernet packets <ul><li>References : </li></ul><ul><ul><li>Computer Networks – Andrew S. Tanenbaum </li></ul></ul><ul><ul><li>Computer Networking : A Top-Down Approach Featuring the Internet – James F. Kurose , Keith W. Ross </li></ul></ul>

×