130 likes | 236 Views
Internetworking: Routing Packets to all the Right Places. Kevin Bolding Electrical Engineering Seattle Pacific University. Info in message header. Info in network tables. Routing. The process of directing a message from its source to its destination is known as routing.
E N D
Internetworking:Routing Packets to all the Right Places Kevin BoldingElectrical EngineeringSeattle Pacific University
Info in message header Info in network tables Routing • The process of directing a message from its source to its destination is known as routing • Methods of routing depend on information in: • The messageheader • How much detail on the path is given in the header? Network layerRouting (Routers) Source Routing • The network itself • How much info on the network’s structure is present in routing tables? Data Link layerRouting (Switches) Broadcast
Send the message from the source to everywhere else Bus- and Hub-based systems work this way Broadcasting S D • The medium is shared at all times by all users • Each of N workstations gets only 1/Nth of the bandwidth on average • Collisions must be sorted out • Broadcasting only works for small LANs
Dealing with Contention • What do we do when more than one message is broadcast at the same time? • 1. Ignore it - That’s what error correction/retry is for • Doesn’t really work - The retries will collide again and again... • 2. Apologize and try again in a more orderly manner • When you see the line is being used, wait your turn • Carrier Sense Multiple Access – CSMA – Used by bus and hub networks. • 3. Prevent collisions from happening in the first place • Won’t work with ordinary broadcast - requires tokens or special hubs
Carrier Sense Multiple Access (CSMA) • CSMA • Before transmitting, check if a signal (carrier) is present • If busy, wait until the network is free and try again • Still may have collisions • Transmissions will “bunch up” after a long message • CSMA/CD (collision detection) • When transmitting, monitor your receiver port to make sure your message is unchanged • Generate a jamming signal if a collision is detected • Reduces the amount of time wasted on collisions • Wait a random amount of time before retry • If another retry is necessary, double the waiting time • Exponential backoff
Collision Prevention • Tokens • Can only broadcast a message when you have the token • Requires a lot of overhead, but works • Demand-based Hubs • Send a request-to-send signal to a smart hub • The hub will only grant one request at a time • Requires • Smart (demand) hub • Protocol support for demand and request-to-send signals • Used for some high-speed LAN protocols
Broadcasting sends all messages to all destinations Overloads networks very quickly Internetworks S • Partition network • Only messages destined for the “other side” need to cross the partition D • A new paradigm is needed! • Some component must look at the message’s destination and determine if it should be passed on or not • Routing is the general solution Routing - Observing the destination of a message to determine where it should go
Message headers each contain the MAC address of their destination Data Link Layer Routing MAC - Media Access Control sub-layer of the Data Link Layer (IEEE 802) MAC Address - Universally uniqueidentifier hardwired into every NIC (at least it used to be that way) • A bridge or switch examines the MAC address and determines its destination Bridge – Connects two networks together. Separates traffic using MAC addresses. May convert protocols. • Requires knowledge of: • MAC addresses of all devices in the network • Relative location of all devices Switch - A device that uses an internal map of the network to route messages based on MAC addresses In Win 7 – Look for Physical Address under network connection details
44 51 82 12 42 B 85 59 13 A 3 Switch 88 52 8 45 C 34 99 10 E 65 7 41 77 D 6 17 5 90 83 Switches MAC Port 3 A 5 D 6 E 7 E 8 C ... S1 D3 Hub Hub S2 • The switch contains a table mapping ports to MAC addresses Hub Hub D1 • Each LAN can now behave independently Hub • Multiple ports of the switch can be used independently D2 S3
Multi-switch Internetworks B2 A2 A3 • Each switch contains table entries for MAC addresses of all networked components • If a message has an unindexed MAC address, the bridge broadcasts it out on all ports A1 2 3 1 B3 B1 C3 C1 5 B5 A4 A6 A5 4 C5 B4 6 D5 • As long as the network has a tree structure, it’s easy • Learning switches will configure themselves B6 C4 D4 C6 D6 17 77 5 90 83
92 92 Internetworks with Loops B2 92 A2 A3 • Networks may have redundant links • Allows short-cutting • Keeps network running when links fail A1 2 3 1 B3 B1 C3 C1 5 • Loops cause problems • Different switches may have “learned” different paths B5 A4 A6 A5 4 C5 B4 6 D5 B6 • Requires more complex configuration • Uses a spanning tree algorithm and a configuration message protocol C4 D4 C6 D6 17 77 5 90 83
Alternative mechanisms may support a different network address than the Data Link layer Higher Level Routing Network Layer - Example:IP (Internet Protocol) IPv4 Address - 32 bits in 4 bytes. Ex: 128.95.32.99 • Why multiple addresses? • MAC addresses have a flat address space • Routing tables for the Internet would require an entry for every possible MAC address Hierarchical - Bytes on the left are more significant for routing than those on the right • Network Layer Addresses are hierarchical • The address itself contains information about where to send the message
Data Link vs. Network Layer Routing • Data Link Routing • For routing within a small-to-medium sized internetwork • All computers on network are “trusted” • Uses Switches and Bridges • Network Routing • The Internet runs using IP routing • Supports complex routing schemes • Supports security (firewalls) • Uses “routers” • More on IP elsewhere next