1 / 41

15-441 Communications and Networking

15-441 Communications and Networking. Lecture 7 Gregory Kesden. The switching portion of these slides evolved from Prof. Steenkiste’s slides circa 2000. Real-World Link Layer Protocols: “Original” Ethernet. Wired physical layer 1-persistence CSMA/CD Manchester encoding

fadhila
Télécharger la présentation

15-441 Communications and Networking

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 15-441 Communications and Networking Lecture 7 Gregory Kesden The switching portion of these slides evolved from Prof. Steenkiste’s slides circa 2000.

  2. Real-World Link Layer Protocols: “Original” Ethernet • Wired physical layer • 1-persistence CSMA/CD • Manchester encoding • Binary exponential backoff upon collision • IEEE 802.3, the adopted standard, has a slightly different frame format than the original Ethernet – but the distinction is not drawn in conversation. • 10Base5, “garden hose” wiring (now obsolete) – up to 500m and 100 stations • 10Base2, “think coax” -- up to 185m and 30 stations • 10Base-T, “twisted pair”, up to 100m and 1024 stations

  3. Real-World Link Layer Protocols Ethernet, cont. • Binary exponential backoff? • Upon a collision, wait and try again, up to 16 times. • How long to wait • For the 0-9th collisions, pick a random number between • [0, 2i-1], and skip that number of slots (opportunities to send). • For collisions 10-15, stick with [0, 210-1], which is 1023 • Give up after that.

  4. Real-World Link Layer Protocols Ethernet, cont. • What exactly is a slot? • The time to send a minimum frame. • The standard sets a maximum length of 2500m • The reference configuration is a 10Mbps LAN with 4 repeaters • Given this, the maximum round-trip propagation time is approximately 50 microseconds (10-6 seconds). • At the spec’d 10Mbps, this makes for a 500 bit minimum frame size. Add a bit of padding for safety and round up to a power-of-two and get a minimum frame size of 512 bits. • So the minimum frame time is 51.2 microseconds. This is a slot time. • Obviously, this increases as the speed of the underlying network increases, e.g. 6400 bytes for a 1Gbps network of up to 2500m in length.

  5. IEEE 802.15 “Bluetooth” S S S S S S M M S S S S S S S Piconet Piconet Scatternet Up to 7 active slaves/piconet, range 10m. Up to 255 parked slaves.

  6. IEEE 802.15 “Bluetooth”, cont • RF physical layer: • 2.4GHz Band • 79 1MhZ bands • FSK, 1 bit/Hz • Frequency hopping at 1600 hops/second • Fairly allocates channels • Reduces multipath fading • Limited security benefit • Shares same bands as 802.1 and can interfere with each other. • Bluetooth hops aster, so it causes more damage to 802.11 than vice-versa.

  7. IEEE 802.15 “Bluetooth”, cont. • “Baseband layer” is the lower piece of the data link layer. • Defines slots • Defines 625 microsecond timeslots • even for self, odd for slaves. • 259 bits of 625 are “settling time” • 366 are usable • 126 data access code and header • 240 bits for data • If five slots are combined for a single frame, 2781 of 3125 bits are available, since settling and other overhead are needed only once. • A link is a logical abstraction • Synchronized Connection Oriented (SCO) for real-time data • Asynchronous Connection-Less (ACL) for packet-switched data

  8. IEEE 802.15 “Bluetooth”, cont. • L2CAP is top half of data link • Breaks packets into frames • Multplexing and demultiplexing of packet sources (higher level senders and receivers) • Quality of service negotiation – for example, balancing needs of small packet and large-packet senders. • Application/Profile layer • Defines 13 types of applications and higher-level stacks for them • Dial-up, fax, cordless telephony, file transfer, synchronization, link management, service discovery, &c

  9. Building Bigger LANs

  10. A Bridge-based Network • Switches are connected by point-point links. • Packets are forwarded hop-by-hop by the switches towards the destination. • Forwarding is based on the address • How do nodes exchange packets over a link? • How does a switch work? • How do adjacent switches manage the link? Point-Point link Switch PCs at Work PC at Home

  11. Bridge Bridges • Multiple LANS may be connected to form one logical LAN • Since bridges are at the link layer, they do not examine network headers, &c. • Reasons • to increase scale, • control load, • allow for long distances, • ease administration, • security/protection LAN LAN

  12. Bridge Architecture • Takes in packets in one interface and has to forward them to an output interface based on the address. • A big intersection • Same idea for bridges, switches, routers: address look up differs • Control processor manages the switch and executes higher level protocols. • E.g. “which way?”, &c. • The switch fabric directs the traffic to the right output port. • The input and output ports deal with transmission and reception of packets. Control Processor Switch Fabric Input Port Output Port Output Port Input Port Output Port Output Port Input Port Input Port

  13. Bridge Fabric Options • Crossbar switch. • Requires lots of hardware but good performance • Multistage interconnection networks an alternative • Bus-based switches. • Fabric consists one (or more) fast shared buses • Each input port has a slot time slot on the bus • Shared memory switch. • Switch is one large memory • Input ports write packets to memory and output ports read packets from memory • Does not scale well: need very fast memory • Hybrid solutions.

  14. I/O Port Functions • Input port identifies the outgoing port and buffers packets if there is contention for the switch fabric. • Output port queues packets and a scheduler determines the order in which packets are sent over the outgoing link. • Many buffering options exist. • Input buffering, output buffering, internal buffering • Typically a combination is used • Buffer management can limit throughput, e.g. head of line blocking Switch Fabric Address Lookup Scheduler Address Lookup

  15. A Simple Bus-based Architecture Input Ports Bus Output Ports

  16. A Crossbar Architecture Input Ports Output Ports

  17. The Knockout Architecture input buses concentrators buffers

  18. Transparent Bridges • Backward learning • “Plug and go” • Listen to traffic on all interfaces • Store each machine that transmits in hash table along with interface. • Periodically purge old entries, just in case a machine moves. • When a frame “hits the wire”, look it up in the hash table and forward it to the correct LAN. • If it originated on the correct LAN, do not forward it. • If the destination of the frame is not in the hashtable, flood all attached LANs.

  19. Bridge Bridge Transparent Bridges, cont. frame1 frame2 LAN LAN frame12 frame frame22 host Consider what can happen if a redundant bridge is used for “robustness”. Both bridges could copy the frame, creating a duplicate.Then, this duplicate could be copied twice, and so on…forever

  20. Bridges with Spanning Trees • The solution is for the bridges to communicate with each other and build spanning trees that represent the network. • One bridge is selected to be the root of the tree, perhaps by serial number “bullying” or other broadcast-based approach. • Then, a minimum spanning tree is constructed from each LAN, through necessary bridges, to the root. • This spanning tree is used to determine how to forward a frame. Connections that are not in the tree cannot be used – even if some bridges are “left out”. • The algorithm continues to run to stay up-to-date and detect bridge failures, host moves, &c.

  21. 1Gbps 100Mbps switched legs Switched Ethernet • Ethernet switches are a type of bridge that have a many-to-one point-to-point relationship. • Many low-bandwidth legs share a high-bandwidth common bus. • Typically one leg, has a very high bandwidth – consider it to be the uplink. Imagine several floors or departments, each of which has its own leg, and then one leg going out to an intranet or the Internet. • Each port on the switch forms its own collision domain. If multiple stations are connected on the same port, as through a concentrator or hub, collisions can occur among them. • Among ports, collisions can be mitigated by buffering inputs

  22. Application Presentation Session Transport Data Link Physical The Network Layer The solution-specific protocol used by the application program. Hides host-specific and/or user-specific nuiances Extends the host-to-host abstraction provided by the Transport layer to include more specific, complex features. Hides the network(s) from the user and provides a host-to-host(s) abstraction. You are here Network Moves data from one network to another Packages data for transmission/reception over a single network. Transmits and receives via a particular media over a single network.

  23. Frame Header Packet Header Frame Payload Packet Payload A Network Packet Network Layer Packet Link Layer Frame • Much as the physical layer wasn’t concerned with the framing performed by the link layer, • the link layer just views the network layer’s headers, &c just as it does the user’s data – • as payload. • From the perspective of the link layer, the network layer packet is just data.

  24. The Network Layer • The physical layer is important, because we need some way of transmitting and receiving signals over the physical media. • The data link layer is important, because we need some way of organizing the communication to allow multiple hosts to send and receive messages given the ability of the media to carry them. • The network lay is important because hosts that are members of separate but interconnected networks may want to communicate.

  25. Application Application Application Presentation Presentation Presentation Session Session Session Transport Transport Transport Data Link Data Link Data Link Physical Physical Physical Encapsulation data data Packet (data) Network Packet (data) Network Network Frame(packet) Frame(packet) current current

  26. Network vs. Internetwork What distinguishes “separate, but interconnected networks” from a single “inter-network”? • One trivial (and non-informative) answer: If a data link protocol is sufficient for the machines to communicate, they are part of a single network. If a network-layer protocol is required, the machines are on separate networks that, compose (at least in part) an inter-network. • A slightly better answer: If the machines are all connected to the same communications channel, they are part of a single network • An even better answer: If the machines are connected to a single communications channel, or several communications channels that logically form one communications channel (as through bridging), they are all part of the same network. • A yet better answer – If the answer to the question “How do I get there?” is interesting, the machines are not connected via one network – they are connected via an inter-network.

  27. The Bottom Line • The job of the network layer is to answer the famous question, “How do I get there from here?”

  28. Bridges “Know it All” • Earlier today we discussed connecting communication channels together using bridges to form a single network. • The important thing to remember about bridges is that they are designed to combine to channels to make them operate like one. • But think about what they must do: learn the location of every host on the network.

  29. Bridges: Too Much To Remember • On those occasions when they don’t know a host’s location, there is a very high price – the frame must be flooded to every machine on the network. • If there are too many machines, it is too costly to know the location of all of them – especially since the lookup must be very, very fast. • If the network is large, traffic is likely to be very high – this makes flooding frames to all interfaces very, very costly. • It would be impossible for one machine to know, and rapidly access, the location of every machine on the Internet, never mind manage it efficiently.

  30. Routers and Network Addresses • Routers are the network-level equivalent of bridges. They connect networks to allow communication between/among them. • But, unlike bridges, they do not attempt to know every machine. Instead, they take advantage of hierarchical addressing and only know how to get a packet to the right network. • Once at the right network, the link-layer can deliver the frame.

  31. Internetworks and Hierarchies • What is needed is some more extensible scheme for finding machines • One way of dealing with scale is to organize things into a hierarchy. • Each level of the hierarchy can handle only one portion of the job.

  32. Consider a mailing address Gregory Kesden School of Computer Science CMU Pittsburgh, PA USA • The letter carrier Brazil isn’t likely to know where I live! How does a letter get from Brazil to me? • International mail is directed to a sorting station in the U.S. This sorting station knows how to get the letter to a sorting station in Pennsylvania. • The Pennsylvania station knows how to get the mail to Pittsburgh • The Pittsburgh station knows how to get it to CMU • Etc, etc, etc. • By breaking things down into a hierarchy, we have to make more decisions, but each decision is more manageable.

  33. Network Level Addressing • Data link layer addresses are “flat” not hierarchical. As discussed, these don’t scale well and, as a result, limit the size of an individual network. • Network layer addresses, much like postal addresses are hierarchical. • The first part of the address identifies the network. The second part of the address identifies the individual host within the network. • The network:host pair is globally unique, but the host id, without the network id, is not necessarily unique. • Sub-networks (“sub nets”), or hierarchies with an individual network, are also possible.

  34. Internet Protocol (IP) Addresses • There are three different classes of IP addresses: • Class A: Those used for large networks (typically very large corporations. Exception: MIT has a class A address. Some other universities had them in the past, but voluntarily gave them up, because there are very few – MIT didn’t give theirs up.) • Class B: Those used for medium sized networks • Class C: Those used for small networks

  35. Address Resolution Protocol (ARP) • ARP is the protocol used to convert from an IP address to a MAC address. • A host that has an IP address, but needs to know the MAC address broadcasts a request to all machines on the LAN. This broadcast uses the LAN’s broadcast address. Each host on the LAN receives this request. The host associated with the request IP address replies. • The host with the matching IP address unicasts its MAC address to the sender. The results of the ARP request are cached on the requestor. • Failure to flush the ARP cache after moving interface cards around is a common cause of self-solving mysteries for novice sys. admins. • “ARP Storms” can result when many systems are turned on at the same time. • ARP includes no security – requestors believe whatever they are told from whomever they are told. • There is a “reverse ARP”, RARP, that can convert a MAC address to a name, but it is complex and has largely been replaced by DHCP.

  36. IP Addresses 1 7 24 Class A 0 Network Host 2 14 16 Class B 10 Network Host 3 21 8 Class C 110 Network Host

  37. IP Addresses: A Few Thoughts • There are very few addresses for large networks and very many for small networks – this makes sense given the number of parties needing 224 host LANs versus those needing 28 host LANs. • There are 232 (about 4 billion) possible addresses, but many are lost due to fragmentation – most groups get blocks of addresses for a whole network, but don’t use nearly so many machines. This fragmentation has generated a shortage of network addresses.

  38. How Does a Host Get an IP Address? • Ethernet MAC addresses are “built in” serial numbers provided by the manufacturer (in theory). • But this won’t work for IP addresses – their address must be related to the network on which they live. • A network’s administrators is assigned a block of addresses (a whole network worth) from IANA (Internet Assigned Number Authority). • The administrator then assigns these addresses to individual devices.

  39. Static Address Assignment • The easiest way to assign IP addresses is a “once and for all approach: the administrator statically assigns an IP address to each device. With luck, the user will give it back when the device dies or is retired. • This devices uses this address every time. • Static assignment isn’t particularly efficient for some types of devices • Mobile hosts, home machines, &c may only require network connectivity during part of the day, but will require an IP address during this time. • If an address is permanently assigned to these transient devices, it is wasted much of the time. • Users often don’t return the address of dead or retired machines – this is also wastage. • This is bad, since IP addresses are in short supply.

  40. Dynamic Address Assignment and DHCP • In order to avoid the wastage associated with permanent, static IP address assignment, many networks use dynamic address assignment. One such protocol is DHCP (Dynamic Host Configuration Protocol) • Each time a machine reboots, it sends out a discovery message via a broadcast to a special IP address (255.255.255.255). • The DHCP server, which hears this message, replies with the assigned IP address. The host then assumes this address. • Since hosts may be transient, the address is leased to machine for a period of time. Unless the machine renews its lease, it will expire and the address can be reassigned to another machine. • Obviously, the DHCP server needs to be assigned a block of IP addresses. This is done by the system administrator.

  41. More about DHCP • Broadcast messages to special addresses, such as the one used for DHCP are not communicated by routers to other networks – if they were, only one DHCP server could exist in the world. • As a result, if the same administration is responsible for multiple networks (or subnetworks), the available addresses would need to be partitioned among the DHCP servers. This isn’t particularly efficient and is an administrative burden. • To avoid this, DHCP relay servers can be used. • One DHCP server can be configured to handle multiple networks (or subnetworks). • One relay server can be placed within each network. • The relay server listens for the DHCP discovery broadcast and relays it to the DHCP server, which then responds directly to the requesting host with its IP address.

More Related