Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPS-356- Computer Networks Class 7: Switching Continued+ Network Layer Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières,

Similar presentations


Presentation on theme: "CPS-356- Computer Networks Class 7: Switching Continued+ Network Layer Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières,"— Presentation transcript:

1 CPS-356- Computer Networks Class 7: Switching Continued+ Network Layer Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti

2 Today’s Lecture Switching (Take II) – Ethernet (datagram) Spanning-Tree – ATM (Virtual Circuits) Network layer: Internet Protocol (v4) Forwarding – Addressing – Fragmentation – ARP – DHCP – NATs

3 Ethernet Switching Hosts come preconfigured with IDs – Each host has a MAC-address Network automatically determines routes – Flood to discover who is connected.

4 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

5 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

6 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

7 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

8 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

9 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

10 Drawbacks of Flooding Can not deal with loops Can not scale to a large number of devices.

11 Drawbacks of Flooding Can not deal with loops – Solution: Spanning Tree Can not scale to a large number of devices. – Solution: VLANs

12 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

13 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

14 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

15 Drawbacks of Flooding LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

16 Drawbacks of Flooding Can not deal with loops – Solution: Spanning Tree Can not scale to a large number of devices. – Solution: VLANs

17 Spanning-Tree Exchange BPDU messages – BPDU = Bridge Protocol Data Unit Discover a routing topology free of loop – Eliminates redundancy: wastes extra links root bridge (what the sender thinks it is) root path cost for sending bridge Identifies sending bridge Identifies the sending port root ID cost bridge ID port ID

18 Building a Spanning Tree: Time 0: Everyone thinks they are ‘root’ LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

19 Building a Spanning Tree: Time 1: Everyone heard from B1. B1 has a lower bridge B1.. Must be root LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob R R R

20 Building a Spanning Tree: Time 2: Tell each other B1 is root LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob R R R

21 Building a Spanning Tree: Time 3: Discover Duplication Turn off ports. LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob R R R D Professors

22 The Spanning Tree Brige1 Brige5 Brige3 Brige4 B B

23 The Spanning Tree Brige1 Brige5 Brige3 Brige4 B B LAN 2 LAN 3 LAN 4 D R R R Port Type Rules RAccept & forward flood traffic. Don’t forward BDPU DAccept & Forward flood traffic. Forward BDPU D D Alice Bob Sent packets Packets not sent TWO WASTED LINKS IN THIS TOPOLOGY

24 Drawbacks of Flooding Can not deal with loops – Solution: Spanning Tree Can not scale to a large number of devices. – Solution: VLANs

25 Virtual LANs Assign switch ports to a VLAN ID (color) – Isolate traffic: only same color – Trunk links may belong to multiple VLANs – Encapsulate packets: add 12-bit VLAN ID Easy to change, no need to rewire LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

26 Virtual LANs Assign switch ports to a VLAN ID (color) – Isolate traffic: only same color – Trunk links may belong to multiple VLANs – Encapsulate packets: add 12-bit VLAN ID Easy to change, no need to rewire LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

27 Virtual LANs Assign switch ports to a VLAN ID (color) – Isolate traffic: only same color – Trunk links may belong to multiple VLANs – Encapsulate packets: add 12-bit VLAN ID Easy to change, no need to rewire LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Alice Bob

28 Other Uses for VLANs (Virtual LANs) Company network, A and B departments – May not want traffic between the two departments – Topology has to mirror physical locations – What if employees move between offices? LAN 2 LAN 3 LAN 4 Brige1 Brige5 Brige3 Brige4 A B A B A B A B Finance: 1 Professors Finance: 1

29 What Do Switches Look Like?

30 Generic Switch Architecture Goal: deliver packets from input to output ports Potential performance concerns: – Throughput in bytes/second – Throughput in packets/second – Latency

31 Shared Memory Switch 1 st Generation – like a regular PC – NIC DMAs packet to memory over I/O bus – CPU examines header, sends to destination NIC – I/O bus is serious bottleneck – For small packets, CPU may be limited too – Typically < 0.5 Gbps

32 Shared Bus Switch 2 st Generation – NIC has own processor, cache of forwarding table – Shared bus, doesn’t have to go to main memory – Typically limited to bus bandwidth (Cisco 5600 has a 32Gbps bus)

33 Point to Point Switch 3 rd Generation: overcomes single-bus bottleneck Example: Cross-bar switch – Any input-output permutation – Multiple inputs to same output requires trickery – Cisco series: 60Gbps

34 Cut through vs. Store and Forward Two approaches to forwarding a packet – Receive a full packet, then send to output port – Start retransmitting as soon as you know output port, before full packet Cut-through routing can greatly decrease latency Disadvantage – Can waste transmission (classic optimistic approach) CRC may be bad If Ethernet collision, may have to send runt packet on output link

35 Cut through Store and forward

36 Buffering Buffering of packets can happen at input ports, fabric, and/or output ports Queuing discipline is very important Consider FIFO + input port buffering – Only one packet per output port at any time – If multiple packets arrive for port 2, they may block packets to other ports that are free – Head-of-line blocking: can limit throughput to ~ 58% under some reasonable conditions* 2 21 Port 1 Port 2 * For independent, uniform traffic, with same-size frames

37 Head-of-Line Blocking Solution: Virtual Output Queueing – Each input port has n FIFO queues, one for each output – Switch using matching in a bipartite graph – Shown to achieve 100% throughput* 2 21 Port 1 Port 2 *MCKEOWN et al.: ACHIEVING 100% THROUGHPUT IN AN INPUT-QUEUED SWITCH, 1999

38 Today’s Lecture Switching (Take II) – Ethernet (datagram) Spanning-Tree – ATM (Virtual Circuits) Network layer: Internet Protocol (v4) Forwarding – Addressing – Fragmentation – ARP – DHCP – NATs

39 ATM Cells Fixed-size packets – 5 bytes header – 48 bytes payload If payload smaller than 48B, uses padding If greater than 48B, breaks it

40 Why small, fixed-length packets? Cons: maximum efficiency 48/53=90.6% Pros: – Suitable for high-speed hardware implementation – Many switching elements doing the same thing in parallel – Reducing priority packet latency Good for QoS – Reducing transmission latency

41 Reducing preemption latency Reduce queuing latency – Transmission + propagation + queuing

42 Why 48 bytes It’s from the telephone technology Thought data would be mostly voice A compromise – US: 64 bytes – Europe: 32 bytes – = 48 bytes

43 Virtual paths 24-bit virtual circuit identifiers (VCIs) – Discussed in our previous lecture Two-levels of VCIs – 8-bit virtual path, 16-bit VCI – Virtual paths shared by multiple connections

44 Today’s Lecture Switching (Take II) – Ethernet (datagram) Spanning-Tree – ATM (Virtual Circuits) Network layer: Internet Protocol (v4) Forwarding – Addressing – Fragmentation – ARP – DHCP – NATs

45 Internet Protocol Goal How to connect everybody? – New global network or connect existing networks? Glue lower-level networks together: – allow packets to be sent between any pair or hosts Wasn’t this the goal of switching? Le Theo Net (ATM) Le Theo Net (ATM) Le Duke Net (Token Ring) Le Duke Net (Token Ring)

46 Internetworking Challenges Heterogeneity – Different addresses – Different service models – Different allowable packet sizes Scaling Congestion control

47 How would you design such a protocol? Circuits or packets (datagram)? – Predictability Service model – Reliability, timing, bandwidth guarantees Any-to-any – Finding nodes: naming, routing – Maintenance (join, leave, add/remove links,…) – Forwarding: message formats

48 How would you design such a protocol? Circuits or packets (datagram)? – Predictability Service model – Reliability, timing, bandwidth guarantees Any-to-any – Finding nodes: naming, routing – Maintenance (join, leave, add/remove links,…) – Forwarding: message formats

49 IP’s Decisions Packet switched – Unpredictability, statistical multiplexing Service model – Lowest common denominator: best effort, connectionless datagram Any-to-any – Common message format – Separated routing from forwarding – Naming: uniform addresses, hierarchical organization – Routing: hierarchical, prefix-based (longest prefix matching) – Maintenance: delegated, hierarchical

50 Packet switched networks: Arpanet’s IMPs – Late 1960’s – RFC 1, 1969! – Segmentation, framing, routing, reliability, reassembly, primitive flow control Network Control Program (NCP) – Provided connections, flow control – Assumed reliable network: IMPs – Used by programs like telnet, mail, file transfer Wanted to connect multiple networks – Not all reliable, different formats, etc… A Bit of History

51 TCP/IP Introduced Vint Cerf, Robert Kahn Replace NCP Initial design: single protocol providing a unified reliable pipe – Could support any application Different requirements soon emerged, and the two were separated – IP: basic datagram service among hosts – TCP: reliable transport – UDP: unreliable multiplexed datagram service

52 An excellent read David D. Clark, “The design Philosophy of the DARPA Internet Protocols”, 1988 Primary goal: multiplexed utilization of existing interconnected networks Other goals (works and works): – Communication continues despite loss of networks or gateways – Support a variety of communication services – Accommodate a variety of networks – Permit distributed management of its resources – Be cost effective – Low effort for host attachment – Resources must be accountable

53 Still An excellent read David D. Clark, “The design Philosophy of the DARPA Internet Protocols”, 1988 Primary goal: multiplexed utilization of existing interconnected networks None-Other goals (other real world issues): – Security – Privacy – Flow money

54 Internet Protocol IP Protocol running on all hosts and routers Routers are present in all networks they join Uniform addressing Forwarding/Fragmentation Complementary: – Routing, Error Reporting, Address Translation Switch (diff framing) Routing

55 IP Protocol Provides addressing and forwarding – Addressing is a set of conventions for naming nodes in an IP network e.g. your name: Theo – Forwarding is a local action by a router: passing a packet from input to output port e.g. how to get to theo IP forwarding finds output port based on destination address (based on mapping) – Also defines certain conventions on how to handle packets (e.g., fragmentation, time to live) Contrast with routing (defines mapping) – Routing is the process of determining how to map packets to output ports (topic of next two lectures)

56 Service Model Connectionless (datagram-based) Best-effort delivery (unreliable service) – packets may be lost – packets may be delivered out of order – duplicate copies of packets may be delivered – packets may be delayed for a long time It’s the lowest common denominator – A network that delivers no packets fits the bill! – All these can be dealt with above IP (if probability of delivery is non-zero…)

57 Format of IP addresses Globally unique (or made seem that way) – 32-bit integers, read in groups of 8-bits: Hierarchical: network + host Originally, routing prefix embedded in address – Class A (8-bit prefix), B (16-bit), C (24-bit) – Routers need only know route for each network

58 128.*.*.*.. Class A *.*.. Class B *.*.. Class B *.* *.*

59 Forwarding Tables Exploit hierarchical structure of addresses: need to know how to reach networks, not hosts Keyed by network portion, not entire address Next address should be local: router knows how to reach it directly* (we’ll see how soon) NetworkNext Address * *.*.* *.* Default

60 Classed Addresses Hierarchical: network + host – Saves memory in backbone routers (no default routes) – Originally, routing prefix embedded in address – Routers in same network must share network part Inefficient use of address space – Class C with 2 hosts (2/255 = 0.78% efficient) – Class B with 256 hosts (256/65535 = 0.39% efficient) – Shortage of IP addresses – Makes address authorities reluctant to give out class B’s Still too many networks – Routing tables do not scale Routing protocols do not scale

61 Subnetting Add another level to address/routing hierarchy Subnet mask defines variable portion of host part Subnets visible only within site Better use of address space

62 Scaling: Supernetting Problem: routing table growth Idea: assign blocks of contiguous networks to nearby networks Called CIDR: Classless Inter-Domain Routing Represent blocks with a single pair – (first network address, count) Restrict block sizes to powers of 2 Use a bit mask (CIDR mask) to identify block size Address aggregation: reduce routing tables

63 CIDR Forwarding Table NetworkNext Address / / / / /

64 Example H1-> H2: H2.ip & H1.mask != H1.subnet => no direct path

65 R1’s Forwarding Table NetworkSubnet MaskNext Address

66 IP v4 packet format

67 IP header details Forwarding based on destination address TTL (time-to-live) decremented at each hop – Originally was in seconds (no longer) – Mostly prevents forwarding loops – Other cool uses… Fragmentation possible for large packets – Fragmented in network if crossing link w/ small frame – MF: more fragments for this IP packet – DF: don’t fragment (returns error to sender) Following IP header is “payload” data – Typically beginning with TCP or UDP header

68 Other fields Version: 4 (IPv4) for most packets, there’s also 6 Header length: in 32-bit units (>5 implies options) Type of service (won’t go into this) Protocol identifier (TCP: 6, UDP: 17, ICMP: 1, …) Checksum over the header

69 Fragmentation & Reassembly Each network has maximum transmission unit (MTU) Strategy – Fragment when necessary (MTU < size of datagram) – Source tries to avoid fragmentation (why?) – Re-fragmentation is possible – Fragments are self-contained datagrams – Delay reassembly until destination host – No recovery of lost fragments

70 Fragmentation Example Ethernet MTU is 1,500 bytes PPP MTU is 576 bytes – R2 must fragment IP packets to forward them

71 Fragmentation Example (cont) IP addresses plus ident field identify fragments of same packet MF (more fragments bit) is 1 in all but last fragment Fragment offset multiple of 8 bytes – Multiply offset by 8 for fragment position original packet

72 Today’s Lecture Switching (Take II) – Ethernet (datagram) Spanning-Tree – ATM (Virtual Circuits) Network layer: Internet Protocol (v4) Forwarding – Addressing – Fragmentation – ARP – DHCP – NATs

73 Translating IP to lower level addresses or… How to reach these local addresses? Map IP addresses into physical addresses – E.g., Ethernet address of destination host – or Ethernet address of next hop router Techniques – Encode physical address in host part of IP address (IPv6) – Each network node maintains lookup table (IP->phys)

74 ARP – address resolution protocol Dynamically builds table of IP to physical address bindings for a local network Broadcast request if IP address not in table All learn IP address of requesting node (broadcast) Target machine responds with its physical address Table entries are discarded if not refreshed

75 ARP Ethernet frame format Why include source hardware address?

76 Obtaining Host IP Addresses - DHCP Networks are free to assign addresses within block to hosts Tedious and error-prone: e.g., laptop going from CIT to library to coffee shop Solution: Dynamic Host Configuration Protocol – Client: DHCP Discover to (broadcast) – Server(s): DHCP Offer to (why broadcast?) – Client: choose offer, DHCP Request (broadcast, why?) – Server: DHCP ACK (again broadcast) Result: address, gateway, netmask, DNS server

77 Obtaining IP Addresses Blocks of IP addresses allocated hierarchically – ISP obtains an address block, may subdivide ISP: / Client 1: / Client 2: / Client 3: / Global allocation: ICANN, /8’s (ran out!) Regional registries: ARIN, RIPE, APNIC, LACNIC, AFRINIC

78 Network Address Translation (NAT) Despite CIDR, it’s still difficult to allocate addresses (2 32 is only 4 billion) We’ll talk about IPv6 later NAT “hides” entire network behind one address Hosts are given private addresses Routers map outgoing packets to a free address/port Router reverse maps incoming packets Problems?

79 Internet Control Message Protocol (ICMP) Echo (ping) Redirect Destination unreachable (protocol, port, or host) TTL exceeded Checksum failed Reassembly failed Can’t fragment Many ICMP messages include part of packet that triggered them See parametershttp://www.iana.org/assignments/icmp- parameters

80 ICMP message format

81 Example: Time Exceeded Code usually 0 (TTL exceeded in transit) Discussion: traceroute

82 Example: Can’t Fragment Sent if DF=1 and packet length > MTU What can you use this for? Path MTU Discovery – Can do binary search on packet sizes – But better: base algorithm on most common MTUs


Download ppt "CPS-356- Computer Networks Class 7: Switching Continued+ Network Layer Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières,"

Similar presentations


Ads by Google