Chapter5b

467 views
406 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
467
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Chapter5b

  1. 1. Chapter 5 Outline <ul><li>Data link layer principles so far: </li></ul><ul><ul><li>services, error detection/correction, multiple access </li></ul></ul><ul><li>Next: LAN technologies </li></ul><ul><ul><li>addressing </li></ul></ul><ul><ul><li>Ethernet </li></ul></ul><ul><ul><li>hubs, bridges, switches </li></ul></ul><ul><ul><li>802.11 </li></ul></ul><ul><ul><li>PPP </li></ul></ul><ul><ul><li>ATM </li></ul></ul>
  2. 2. LAN Addresses <ul><li>32-bit IP address: </li></ul><ul><li>network-layer address </li></ul><ul><li>used to get a datagram to a destination network (recall definition of an IP network) </li></ul><ul><li>LAN (or MAC, or physical ) address: </li></ul><ul><li>used to get a datagram from one interface to another physically-connected interface ( same network ) </li></ul><ul><li>48 bit MAC address (for most LANs): permanent address, burned into the adapter ROM </li></ul>Q: How many possible LAN/Physical addresses? A: 2 46  70 trillion
  3. 3. LAN Addresses Each adapter on a LAN has a unique LAN address
  4. 4. LAN Address (more) <ul><li>MAC address allocation administered by IEEE </li></ul><ul><li>manufacturer buys the leading 3 bytes of the MAC address space (to assure uniqueness) see current assignments </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 => 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 network to which one attaches </li></ul></ul>
  5. 5. Recall earlier routing discussion <ul><li>Starting at A, given an IP datagram addressed to B: </li></ul><ul><li>look up network address of B, find B on same network as A </li></ul><ul><li>link layer sends a datagram to B inside link-layer frame </li></ul>B’s MAC address A’s MAC address A’s IP address B’s IP address IP payload datagram frame frame source, destination address datagram source, destination address 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E
  6. 6. ARP: A ddress R esolution P rotocol <ul><li>Each IP node (Hosts & Routers) on a LAN has an ARP module and 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 minutes) </li></ul></ul>Question: how can we determine the MAC address of B given B’s IP address?
  7. 7. ARP protocol (RFC 826) <ul><li>A wants to send datagram to B, and A knows B’s IP address. </li></ul><ul><li>Suppose B’s MAC address is 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>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>Side effects… performance implications? <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 manual intervention </li></ul></ul>
  8. 8. Routing to another LAN <ul><li>walk-through: routing from A to B via R </li></ul>A R B 111.111.111.0 222.222.222.0
  9. 9. <ul><li>LAN to LAN Walk-through: </li></ul><ul><li>A creates an IP packet with IP addresses of source A and destination B </li></ul><ul><li>A determines next hop to get to B is router R (from routing table) </li></ul><ul><li>A uses ARP to get R’s physical layer address for IP 111.111.111.110 </li></ul><ul><li>A creates a LAN1 frame with R's physical address as destination, the frame contains A-to-B IP datagram </li></ul><ul><li>A’s data link layer sends LAN1 frame </li></ul><ul><li>R’s data link layer receives LAN1 frame </li></ul><ul><li>R removes IP datagram from LAN1 frame, sees it is destined to B </li></ul><ul><li>R determines next hop, local in this case, to B (from routing table) </li></ul><ul><li>R uses ARP to get B’s physical layer address </li></ul><ul><li>R creates a LAN2 frame containing A-to-B IP datagram and sends it to B </li></ul>A R B 111.111.111.0 222.222.222.0
  10. 10. Chapter 5 outline <ul><li>5.1 Introduction and services </li></ul><ul><li>5.2 Error detection and correction </li></ul><ul><li>5.3Multiple access protocols </li></ul><ul><li>5.4 LAN addresses and ARP </li></ul><ul><li>5.5 Ethernet </li></ul><ul><li>5.6 Hubs, bridges, and switches </li></ul><ul><li>5.7 Wireless links and LANs </li></ul><ul><li>5.8 PPP </li></ul><ul><li>5.9 ATM </li></ul><ul><li>5.10 Frame Relay </li></ul>
  11. 11. Ethernet <ul><li>“dominant” LAN technology: </li></ul><ul><li>cheap <$4 for 100Mbs! </li></ul><ul><li>first widely used LAN technology </li></ul><ul><li>Simpler, cheaper than token LANs and ATM </li></ul><ul><li>Kept up the pace: 10 Mbps, 100 Mbps, 1 Gbps </li></ul>Metcalfe’s Ethernet Sketch (10Base5)
  12. 12. LAN Cost Trends Fort Worth Star-Telegram July 27, 2005 $3 99 $19 99
  13. 13. 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 (frame delimiter) </li></ul><ul><li>used to synchronize receiver, sender clock rates </li></ul>(802.3 Data Length) Note: IEEE 802.3 specifies that frame length, excluding preamble, must be between 64 and 1518 bytes. Data is padded, if necessary, to 46 bytes to ensure minimum length is achieved.
  14. 14. Ethernet Frame Structure (more) <ul><li>Addresses: 6 bytes , frame is received by all adapters on a LAN and dropped if address does not match </li></ul><ul><li>Type (Length): 2 bytes , indicates the higher layer protocol, mostly IP but others may be supported such as Novell IPX and AppleTalk). If 802.3 compliant, this field is length of data segment (min. 46 bytes) </li></ul><ul><li>CRC: 4 bytes , checked at receiver, if error detected, the frame is simply dropped </li></ul>
  15. 15. Unreliable, connectionless service <ul><li>Connectionless: No handshaking between sending and receiving adapter. </li></ul><ul><li>Unreliable: receiving adapter doesn’t send ACKs or NACKs to sending adapter </li></ul><ul><ul><li>stream of datagrams passed to network layer can have gaps </li></ul></ul><ul><ul><li>gaps will be filled if app is using TCP </li></ul></ul><ul><ul><li>otherwise, app will see the gaps </li></ul></ul>
  16. 16. Ethernet uses CSMA/CD <ul><li>No slots (only “pseudo-slots”) </li></ul><ul><li>Manchester encoding at bit-level </li></ul><ul><li>adapter doesn’t transmit if it senses that some other adapter is transmitting, that is, carrier sense </li></ul><ul><li>transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection </li></ul><ul><li>Before attempting a retransmission, adapter waits a random time, that is, random access </li></ul>
  17. 17. Ethernet CSMA/CD algorithm <ul><li>1. Adaptor gets datagram from IP and creates frame </li></ul><ul><li>2. If adapter senses channel idle, it starts to transmit the frame. If it senses channel busy, it waits until the channel is idle (+ 96 bit times) and then transmits </li></ul><ul><li>3. If adapter transmits the entire frame without detecting another transmission, the adapter is done with that frame ! </li></ul><ul><li>4. If adapter detects another transmission while transmitting, it aborts and sends a jam signal </li></ul><ul><li>5. After aborting, adapter enters exponential backoff : after the m th collision, adapter chooses a value K at random from {0,1,2,…,2 m -1}. The adapter then waits K*512 bit times and returns to Step 2 </li></ul>
  18. 18. Ethernet’s CSMA/CD (more) <ul><li>Jam Signal: make sure all other transmitters are aware of collision; 48 bits; </li></ul><ul><li>Bit time: 0.1 microsec for 10 Mbps Ethernet ; for K=1023, wait time is about 50 msec </li></ul>Q: What is the relationship between minimum backoff time of 51.2  sec, minimum frame size and max distance allowed between nodes? <ul><li>Exponential Backoff: </li></ul><ul><li>Goal : adapt retransmission attempts to estimated current load </li></ul><ul><ul><li>heavy load: random wait will be longer </li></ul></ul><ul><li>first collision: choose K from {0,1}; delay is K x 512 bit transmission times </li></ul><ul><li>after second collision: choose K from {0,1,2,3}… </li></ul><ul><li>after ten collisions, choose K from {0,1,2,3,4,…,1023}, after 15 tries, abort </li></ul>See/interact with Java applet on AWL Web site: highly recommended !
  19. 19. Course Wrap-up Plan <ul><li>Quiz 6 (now 7/31) </li></ul><ul><li>Exam 2 (100’s around) </li></ul><ul><li>Project/Paper (8/2) </li></ul><ul><li>Wrap-up/Review (8/2) </li></ul><ul><li>Comprehensive Final Exam Tuesday, 8/7/2007 NH 229 (this room) </li></ul>
  20. 20. Ethernet’s CSMA/CD (more) A Station A begins transmission at t =0 A Station A captures channel at t = t prop
  21. 21. Ethernet’s CSMA/CD (more) It takes 2 t prop to find out if channel has been captured  An Ethernet “slot” can be defined as 2t prop A begins to transmit at t =0 A B B begins to transmit at t = t prop -  B detects collision at t = t prop A B A B A detects collision at t = 2 t prop - 
  22. 22. <ul><li>Probability of 1 successful transmission: </li></ul>Ethernet’s CSMA/CD Efficiency P success is maximized at p =1/ n : n P max frame contention frame
  23. 23. Ethernet’s CSMA/CD Efficiency <ul><li>Recall that the probability of successful transmission in a slotted protocol with n stations always ready to transmit is: P = np(1-p) (n-1) </li></ul><ul><ul><li>which yields a mean probability of success (efficiency) of P = 1/e , for an optimal p = 1/n as n -> infinity. </li></ul></ul><ul><li>Note that each 802.3 “slot” has a duration of the one-bit RTT (max) for the LAN (51.2  sec) = 2 *t prop (1) </li></ul><ul><li>The average contention interval length (i.e., how long you must wait) is the duration of the interval (or, slot) divided by the probability, or: 2 *t prop / 1/e = 2e*t prop </li></ul><ul><li>Taking t frame to be the time it takes to transmit an average frame, channel efficiency can then be expressed as: </li></ul>t frame t frame + t prop + 2e t prop 1 1 + 6.4 t prop /t frame  <ul><li>t prop accounts for delays associated with 2500m trip, traversing 4 repeaters in each direction </li></ul><ul><li>Try this for 10Mbps Ethernet: max extent, max frame size, end to propagation speed of 2x10 8 m/sec </li></ul>(2)
  24. 24. Ethernet’s CSMA/CD Efficiency Channel Efficiency Number of Stations Trying to Send 0 1 2 4 8 16 32 64 128 256 512 1.0 0.9 0.8 0,7 0.6 0.5 0.4 0.3 0.2 0.1 1024 byte frames 512 byte frames 128 byte frames 256 byte frames 64 byte frames
  25. 25. Chapter 5 outline <ul><li>5.1 Introduction and services </li></ul><ul><li>5.2 Error detection and correction </li></ul><ul><li>5.3Multiple access protocols </li></ul><ul><li>5.4 LAN addresses and ARP </li></ul><ul><li>5.5 Ethernet </li></ul><ul><ul><li>Principles </li></ul></ul><ul><ul><li>Technologies </li></ul></ul><ul><li>5.6 Hubs, bridges, and switches </li></ul><ul><li>5.7 Wireless links and LANs </li></ul><ul><li>5.8 PPP </li></ul><ul><li>5.9 ATM </li></ul><ul><li>5.10 Frame Relay </li></ul>
  26. 26. Ethernet Technologies: 10Base2 <ul><li>10: 10Mbps; 2: under 200 meters (actually 185) max. cable length per segment </li></ul><ul><li>thin coaxial cable in a bus topology </li></ul><ul><li>repeaters used to connect up to five segments </li></ul><ul><li>repeater repeats bits it hears on one interface to its other interfaces: physical layer device only! </li></ul>
  27. 27. Ethernet Technologies: 10Base2
  28. 28. Ethernet Technologies: 10Base2
  29. 29. 10BaseT and 100BaseT <ul><li>10/100 Mbps rate; latter called “fast ethernet” </li></ul><ul><li>T stands for Twisted Pair </li></ul><ul><li>Nodes are connected to hubs by twisted pair, thus “star topology” </li></ul><ul><li>CSMA/CD monitoring can be implemented at hub </li></ul>
  30. 30. 10BaseT and 100BaseT (more) <ul><li>Max. distance from node to Hub is 100 meters </li></ul><ul><ul><li>max. between any two nodes connected to same hub is 200 meters </li></ul></ul><ul><li>Some hubs can disconnect “jabbering” adapter </li></ul><ul><li>Some hubs can gather monitoring information, statistics for display to LAN administrators (so-called “intelligent” hub) </li></ul><ul><li>Fiber links can be used to expand geographical reach (per IEEE 802) </li></ul>Q: How do you calculate the time it takes to send a datagram from one node to another via a hub?
  31. 31. 10BaseT and 100BaseT (more)
  32. 32. Gigabit Ethernet <ul><li>IEEE 802.3z </li></ul><ul><li>use standard Ethernet frame format </li></ul><ul><li>allows for point-to-point links (via switches) and shared broadcast channels (hubs) </li></ul><ul><li>in shared mode, CSMA/CD is used; short distances between nodes to be efficient </li></ul><ul><li>uses hubs, called here “Buffered Distributors” </li></ul><ul><li>Full-Duplex at 1 Gbps for point-to-point links </li></ul>
  33. 33. Token Ring: IEEE802.5 standard <ul><li>4 Mbps, 16 Mbps </li></ul><ul><li>max token holding time: 10 ms, limiting frame length </li></ul><ul><li>SD, ED mark start, end of packet (each 8 bits) </li></ul><ul><li>AC: access control byte (8bits): </li></ul><ul><ul><li>token bit: value 0 means token can be seized, value 1 means data follows FC </li></ul></ul><ul><ul><li>priority bits: priority of packet </li></ul></ul><ul><ul><li>reservation bits: station can write these bits to prevent stations with lower priority packet from seizing token after token becomes free </li></ul></ul>ED
  34. 34. Token Ring: IEEE802.5 standard <ul><li>FC: frame control used for monitoring and maintenance (8 bits) </li></ul><ul><li>source, destination address: 48 bit physical address, as in Ethernet </li></ul><ul><li>data: packet from network layer </li></ul><ul><li>checksum: CRC (32 bits) </li></ul><ul><li>FS: frame status: set by dest., read by sender (8 bits) </li></ul><ul><ul><li>set to indicate destination up, frame copied OK from ring </li></ul></ul><ul><ul><li>DLC-level ACKing </li></ul></ul>ED
  35. 35. Interconnecting LANs <ul><li>Q: Why not just one big LAN? </li></ul><ul><li>Limited amount of supportable traffic: on single LAN, all stations must share bandwidth </li></ul><ul><li>limited length: 802.3 specifies maximum cable length </li></ul><ul><li>large “collision domain” (can collide with many stations) </li></ul><ul><li>limited number of stations: 802.5 have token passing delays at each station </li></ul>
  36. 36. Devices for Interconnecting LANs <ul><li>Hubs (repeaters) </li></ul><ul><ul><li>physical-layer bit-level replication (possibly amplified) </li></ul></ul><ul><ul><li>extend physical reach of a LAN </li></ul></ul><ul><ul><li>10/100BaseT interconnection (repeaters for 10Base2) </li></ul></ul><ul><li>Bridges </li></ul><ul><ul><li>link-layer, frame switches </li></ul></ul><ul><ul><li>extend physical reach and scale of a LAN </li></ul></ul><ul><ul><li>allow logical segregation of a LAN </li></ul></ul><ul><li>Switches </li></ul><ul><ul><li>Link-layer, high performance bridge </li></ul></ul>
  37. 37. Hubs <ul><li>Physical Layer devices (repeaters: “active” hub) operating at bit levels: repeat received bits on one interface to all other interfaces </li></ul><ul><li>Hubs can be arranged in a hierarchy (or multi-tier design), with a backbone hub at its top </li></ul>
  38. 38. Hubs (more) <ul><li>Each connected LAN referred to as LAN segment </li></ul><ul><li>Hubs do not isolate collision domains: a node’s frames may collide with any other node’s residing at any segment in LAN </li></ul><ul><li>Hub Advantages: </li></ul><ul><ul><li>simple, inexpensive device </li></ul></ul><ul><ul><li>multi-tier provides graceful degradation: portions of the LAN continue to operate if one hub malfunctions </li></ul></ul><ul><ul><li>troubleshooting made easier </li></ul></ul><ul><ul><li>extends maximum distance between node pairs (100m per Hub) </li></ul></ul>
  39. 39. Hub limitations <ul><li>single collision domain results in no increase in max throughput </li></ul><ul><ul><li>multi-tier throughput same as single segment throughput </li></ul></ul><ul><li>individual LAN restrictions pose limits on number of nodes in same collision domain and on total allowed geographical coverage </li></ul><ul><li>cannot connect different Ethernet speeds (e.g., 10BaseT and 100baseT </li></ul>Hub: “Bit In, Bit Out”
  40. 40. Hubs and repeaters <ul><li>LAN segment can be connected by repeaters </li></ul><ul><li>Maximum distance between nodes is 2500 meters for 10BaseT (IEEE 802.3) </li></ul><ul><li>5-4-3 rule </li></ul>For Fiber optic backbone: 7-6-5 rule applies
  41. 41. Hubs and repeaters
  42. 42. Hubs and repeaters
  43. 43. Interconnecting with hubs <ul><li>Backbone hub interconnects LAN segments </li></ul><ul><li>Extends maximum distance between nodes (how far?) </li></ul><ul><li>HOWEVER , individual segment collision domains become one large collision domain </li></ul><ul><li>Can’t interconnect 10BaseT & 100BaseT (and, generally, cannot connect dissimilar media types) </li></ul>hub hub hub hub
  44. 44. Switch <ul><li>Formerly a “bridge,” or bridging device </li></ul><ul><li>Layer-2 (data link layer) device </li></ul><ul><ul><li>stores and forwards Ethernet frames </li></ul></ul><ul><ul><li>examines frame header and selectively forwards frame based on MAC dest address </li></ul></ul><ul><ul><li>when frame is to be forwarded on segment, uses CSMA/CD to access segment </li></ul></ul><ul><li>Host-transparent bridging </li></ul><ul><ul><li>hosts are unaware of presence of switches </li></ul></ul><ul><ul><li>Transparent “bridging” between devices </li></ul></ul><ul><li>Plug-and-play, self-learning </li></ul><ul><ul><li>switches do not need to be configured </li></ul></ul>
  45. 45. Switches
  46. 46. Forwarding <ul><li>How does the switch determine onto which LAN segment to forward a frame? </li></ul><ul><li>Looks like a routing problem, but … </li></ul>1 2 3 Frame ? hub hub hub switch
  47. 47. Self learning <ul><li>A switch has a switch (bridging) table </li></ul><ul><li>entry in switch table: </li></ul><ul><ul><li>{MAC Address, Interface, Time Stamp} </li></ul></ul><ul><ul><li>stale entries in table dropped (TTL usually 20-60 minutes) </li></ul></ul><ul><li>switch learns which hosts can be reached through which interfaces </li></ul><ul><ul><li>when a frame is received, switch “learns” location of sender: incoming LAN segment </li></ul></ul><ul><ul><li>Switch records sender(MAC address)/location (output adapter) pair in its switch table </li></ul></ul>
  48. 48. Filtering/Forwarding <ul><li>When switch receives a frame: </li></ul><ul><li>index switch table using MAC dest address </li></ul><ul><li>if entry found for destination then{ </li></ul><ul><li>if dest on segment from which frame arrived then drop the frame </li></ul><ul><li>else forward the frame on interface indicated </li></ul><ul><li>} </li></ul><ul><li>else flood </li></ul>forward on all but the interface on which the frame arrived
  49. 49. Switch example <ul><li>Suppose C sends frame to D </li></ul><ul><li>Switch receives frame from node C </li></ul><ul><ul><li>notes in bridge table that C is on interface 1 </li></ul></ul><ul><ul><li>because D is not in table, switch forwards frame into interfaces 2 and 3 </li></ul></ul><ul><li>frame received by D </li></ul>hub hub hub switch A B C D E F G H I address interface A B E G C 1 1 2 3 1 1 2 3
  50. 50. Switch example <ul><li>Suppose D replies back with frame to C. </li></ul><ul><li>Switch receives reply/ack frame from node D </li></ul><ul><ul><li>notes in bridge table that D is on interface 2 </li></ul></ul><ul><ul><li>because C is in table, switch forwards frame only to interface 1 </li></ul></ul><ul><li>frame received by C </li></ul>hub hub hub switch A B C D E F G H I address interface A B E G C D 1 1 2 3 1 2 1 2 3
  51. 51. Switch: traffic isolation <ul><li>switch installation breaks subnet into LAN segments </li></ul><ul><li>switch filters packets: </li></ul><ul><ul><li>same-LAN-segment frames not usually forwarded onto other LAN segments </li></ul></ul><ul><ul><li>segments become separate collision domains (i.e frames sent for destinations on same segment are not sent onto other segments – most of the time) </li></ul></ul>hub hub hub switch collision domain 3 collision domain 2 collision domain 1
  52. 52. Switches: dedicated access <ul><li>Switches can have many interfaces </li></ul><ul><li>Hosts have direct connection to switch </li></ul><ul><li>Switch provides dedicated paths between pairs of hosts </li></ul><ul><li>No collisions; full duplex </li></ul><ul><li>Switching: A-to-A’ and B-to-B’ simultaneously, no collisions </li></ul>switch A A’ B B’ C C’
  53. 53. More on Switches <ul><li>cut-through switching: frame forwarded from input to output port without first collecting entire frame </li></ul><ul><ul><li>slight reduction in latency </li></ul></ul><ul><li>combinations of shared/dedicated, 10/100/1000 Mbps interfaces </li></ul>
  54. 54. Institutional network hub hub hub switch to external network router IP subnet mail server web server
  55. 55. Switches vs. Routers <ul><li>both store-and-forward devices </li></ul><ul><ul><li>routers: network layer devices (examine network layer headers) </li></ul></ul><ul><ul><li>switches are link layer devices </li></ul></ul><ul><li>routers maintain routing tables, implement routing algorithms </li></ul><ul><li>switches maintain switch tables, implement filtering, learning algorithms </li></ul>
  56. 56. Summary comparison no yes yes cut-through yes no no optimal routing no yes yes plug & play yes yes no traffic isolation Routers Switches Hubs

×