Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Data Link Layer Goal of this lecture:  Introduce data link layer concepts and protocols Contents:  Link Layer Services  Medium Access Methods  MAC.

Similar presentations


Presentation on theme: "1 Data Link Layer Goal of this lecture:  Introduce data link layer concepts and protocols Contents:  Link Layer Services  Medium Access Methods  MAC."— Presentation transcript:

1 1 Data Link Layer Goal of this lecture:  Introduce data link layer concepts and protocols Contents:  Link Layer Services  Medium Access Methods  MAC Protocols  LAN Technologies  ARP & RARP

2 2 Link Layer Protocols

3 3 Link Layer Services  Framing and link access: encapsulate datagram into frame adding header and trailer, implement channel access if shared medium, ‘physical addresses’ are used in frame headers to identify source and destination of frames on broadcast links  Reliable Delivery: seldom used on fiber optic, co-axial cable and some twisted pairs too due to low bit error rate. Used on wireless links, where the goal is to reduce errors thus avoiding end-to-end retransmissions  Flow Control: pacing between senders and receivers  Error Detection: errors are caused by signal attenuation and noise. Receiver detects presence of errors: it signals the sender for retransmission or just drops the corrupted frame  Error Correction: mechanism for the receiver to locate and correct the error without resorting to retransmission

4 4 Link Layer Protocol Implementation  Link layer protocol entirely implemented in the adapter (e.g., PCMCIA card). Adapter typically includes: RAM, DSP chips, host bus interface, and link interface  Adapter send operations: encapsulates (set sequence numbers, feedback info, etc.), adds error detection bits, implements channel access for shared medium, transmits on link  Adapter receive operations: error checking and correction, interrupts host to send frame up the protocol stack, updates state info regarding feedback to sender, sequence numbers, etc.

5 5 Medium Access Links and Protocols  Two types of links: (a) Point-to-point (single wire) (b) Broadcast (shared wire or medium; eg, Ethernet, wireless, etc.) We focus on Broadcast links. Main challenge: Medium Access Protocol

6 6 Medium Access Protocols  Another human analogy: A classroom - Teacher(s) and student(s) share the same, single, broadcast channel  Central problem: Who gets to talk?, i.e., transmit on the channel  Evolved set of protocols for sharing the broadcast channel o“Give everyone a chance to speak” o“Don’t speak until you are spoken to” o“Don’t monopolize the conversation” o“Raise your hand if you have a question” o“Don’t interrupt when someone is speaking” o“Don’t fall asleep when someone else is talking”

7 7 Medium Access Control Protocols  MAC protocol: coordinates transmissions from different stations in order to minimize/avoid collisions oChannel Partitioning MAC protocols (TDM, FDM) oRandom Access MAC protocols o“Taking turns” MAC protocols  Goal: efficient, fair, simple, decentralized R bps

8 8 Random Access protocols  A node transmits at random (i.e., no apriory coordination among nodes) at full channel data rate R.  If two or more nodes “collide”, they retransmit at random times  The random access MAC protocol specifies how to detect collisions and how to recover from them (via delayed retransmissions, for example)  Examples of random access MAC protocols: (a) ALOHA (b) SLOTTED ALOHA (c) CSMA and CSMA/CD

9 9 CSMA (Carrier Sense Multiple Access)  CSMA: listen before transmit. If channel is sensed busy, defer transmission  Persistent CSMA: retry immediately when channel becomes idle (this may cause instability)  Non-persistent CSMA: retry after random interval  Note: collisions may still exist, since two stations may sense the channel idle at the same time (or better, within a “vulnerable” window = round trip delay)  In case of collision, the entire frame transmission time is wasted

10 10 CSMA/CD (Collision Detection)  CSMA/CD: carrier sensing and deferral like in CSMA. But, collisions are detected within a few bit times.  Transmission is then aborted, reducing the channel wastage considerably.  Collision detection is easy in wired LANs (eg, E-net): can measure signal strength on the line  Collision detection cannot be done in wireless LANs (the receiver is shut off while transmitting, to avoid damaging it with excess power)  CSMA/CD can approach channel utilization =1 in LANs (low ratio of propagation over packet transmission time)

11 11 “Taking Turns” MAC protocols  We have seen that channel partitioning MAC protocols (TDM, FDM) can share the channel fairly; but a single station cannot use it all  Random access MAC protocols allow a single user full channel rate; but cannot share the channel fairly  Taking Turns MAC protocols achieve both fairness and full rate, at the expense of some extra control overhead oPolling: a Master station on a LAN in turn “invites” the slave stations to transmit their packets (up to a Max). Problems: Request to Send overhead, single point of failure (Master) oToken passing: the control token is passed from one node to the next sequentially. Can improve fault tolerance (in a token bus configuration). Still, elaborate procedures to recover from lost token.

12 12 LAN technologies  MAC protocols used in LANs, to control access to the channel  Token Ring: IEEE 802.5 (IBM token ring), for computer room, or Department connectivity, up to 16Mbps; FDDI (Fiber Distributed Data Interface), for Campus and Metro connectivity, up to 200 stations, at 100Mbps.  Ethernet: employ the CSMA/CD protocol; 10Mbps (IEEE 802.3), Fast E-net (100Mbps), Giga E-net (1,000 Mbps); by far the most popular LAN technology

13 13 Ethernet  Widely deployed because: oFirst LAN technology oSimpler and less expensive than token LANs and ATM oKept up with the speed race: 10, 100, 1000, and higher Mbps oMany E-net technologies (cable, fiber, etc). But they all share common characteristics

14 14 Ethernet Frame Structure  Sending adapter encapsulates an IP datagram (or other network layer protocol packet) in Ethernet Frame which contains a Preamble, a Header, Data, and CRC fields  Preamble: 7 bytes with the pattern 10101010 followed by one byte with the pattern 10101011; used for synchronizing receiver to sender clock (clocks are never exact, some drift is highly likely)  Header contains Destination and Source Addresses and a Type field  Addresses: 6 bytes, frame is received by all adapters on a LAN and dropped if address does not match  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

15 15 Ethernet Technologies: 10Base2  10=>10Mbps; 2=>under 200 meters maximum length of a cable segment; also referred to as “Cheapnet”  Uses thin coaxial cable in a bus topology  Repeaters are used to connect multiple segments (up to 5); a repeater repeats the bits it hears on one interface to its other interfaces, ie a physical layer device only!

16 16 10BaseT and 100BaseT  10/100 Mbps rate; latter called “Fast Ethernet”  T stands for Twisted Pair  Hub to which nodes are connected by twisted pair, thus “star topology”  CSMA/CD implemented at the Hub  Max distance from node to Hub is 100 meters  Hub can disconnect a “jabbering adapter”; 10base2 would not work if an adapter does not stop transmitting on the cable  Hub can gather monitoring information and statistics for display to LAN administrators

17 17 Gigabit Ethernet  Use standard Ethernet frame format  Allows for point-to-point links and shared broadcast channels  In shared mode, CSMA/CD is used; short distances between nodes to be efficient  Full-Duplex at 1 Gbps for point-to-point links

18 18 LAN Addresses and ARP  IP address: drives the packet to destination network  LAN (or MAC or Physical) address: drives the packet to the destination node’s LAN interface card (adapter card) on the LAN  48-bit MAC address (for most LANs); burned in the adapter ROM

19 19 LAN Address (cont)  MAC address allocation administered by IEEE  A manufacturer buys a portion of the address space (to assure uniqueness)  MAC flat address structure => portability  IP hierarchical address NOT portable (need mobile IP)  Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address  Broadcast LAN address: 1111………….1111

20 20 Packet Delivery  Delivery of a packet to a host or a router requires two levels of addressing  Logical => IP Addresses  Physical => MAC addresses  Mapping of a logical address to its corresponding physical address and vice versa is required

21 21 Mapping  Static mapping  a table stored in each machine on the network that associates a logical address with a physical address  Dynamic mapping  knowing one of the two (logical or physical) address; uses a protocol to find the other one  address resolution protocol (ARP)  reverse address resolution protocol (RARP)

22 22 ARP: Address Resolution Protocol  Each IP node (Host, Router) on the LAN has ARP module and Table  ARP Table: IP/MAC address mappings for some LAN nodes  TTL (Time To Live): timer, typically 20 min

23 23 ARP (cont)  Host A wants to send packet to destination IP addr XYZ on the same LAN  Source Host first checks own ARP Table for IP addr XYZ  If XYZ not in the ARP Table, ARP module broadcasts ARP pkt:  ALL nodes on the LAN accept and inspect the ARP pkt  Node XYZ responds with unicast ARP pkt carrying own MAC addr:  MAC address cached in ARP Table

24 24 Routing Packets to another LAN  Say, route packet from source IP addr to destination addr  In routing table at source Host, find router 111.111.111.110  In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc.

25 25 ARP and RARP

26 26 ARP  An IP datagram must be encapsulated in a frame to pass through the physical network. This requires the physical address of the receiver.  ARP associates an IP address with its physical address.

27 27 Obtaining the Physical Address  When the physical address of another host is required an ARP query packet is sent which includes  IP address of sender  IP address of the receiver  The intended recipient recognises its IP address and sends back an ARP response which contains the physical address.

28 28 ARP Operation

29 29 ARP Message Format

30 30 Encapsulation An ARP message is encapsulated directly into a data link frame.

31 31 ARP functions  Sender knows IP address  IP asks ARP to create an ARP request message  sender physical address  sender IP address  target IP address  target physical address filled with 0's

32 32 ARP functions  Message passed to data link layer; destination address = broadcast address  All hosts receive frame; only target host accepts the packet  Target host replies (unicast) with an ARP reply message containing the physical address  Sender receives reply; it now knows the physical address of the target host  IP datagram's are now unicast to the destination host

33 33 Cache Table  A sender usually has more than one IP datagram to send to the same destination  It is inefficient to use ARP for each datagram  A cache table is used  limited size  mappings retained only for a limited time

34 34 Components

35 35 RARP: Reverse ARP  Finds the logical address for a host that only knows its physical address  RARP request packets are broadcast; RARP reply packets are unicast  Used by diskless machines to obtain their IP addresses

36 36 RARP Operation

37 37 Summary You now hopefully have:  a good understanding of the data layer link protocols and issues  ARP: Address Resolution Protocol  RARP: Reverse Address Resolution Protocol  Further Reading  RFC:903 Reverse Address Resolution Protocol ohttp://www.faqs.org/rfcs/rfc903.html  RFC:826 An Ethernet Address Resolution Protocol ohttp://www.faqs.org/rfcs/rfc826.html


Download ppt "1 Data Link Layer Goal of this lecture:  Introduce data link layer concepts and protocols Contents:  Link Layer Services  Medium Access Methods  MAC."

Similar presentations


Ads by Google