1 overview, tcp/ip stack, arp, lan switching, ip, subnetting, udp, tcp, nat reviewing the course

Download 1 Overview, TCP/IP Stack, ARP, LAN Switching, IP, Subnetting, UDP, TCP, NAT Reviewing the Course

If you can't read please download the document

Upload: lee-hicks

Post on 18-Jan-2018

235 views

Category:

Documents


1 download

DESCRIPTION

3 TCP/IP Stack and OSI Reference Model The TCP/IP protocol stack does not define the lower layers of a complete protocol stack

TRANSCRIPT

1 Overview, TCP/IP Stack, ARP, LAN Switching, IP, Subnetting, UDP, TCP, NAT Reviewing the Course 2 Networking Concepts Protocol Architecture (Stack or Suite) Protocol Layers Encapsulation Network Abstractions 3 TCP/IP Stack and OSI Reference Model The TCP/IP protocol stack does not define the lower layers of a complete protocol stack 4 TCP/IP Protocol Stack IP is the waist of the hourglass of the Internet protocol architecture Multiple higher-layer protocols Multiple lower-layer protocols Only one protocol at the network layer. 5 Assignment of Protocols to Layers 6 Sending a packet from Argon to Neon 7 DNS: The IP address of neon.tcpip-lab.edu is ARP: What is the MAC address of ? Sending a packet from Argon to Neon DNS: What is the IP address of neon.tcpip-lab.edu ? ARP: The MAC address of is 00:e0:f9:23:a8: is not on my local network. Therefore, I need to send the packet to my default gateway with address frame is on my local network. Therefore, I can send the packet directly. ARP: The MAC address of is 00:20:af:03:98:28 ARP: What is the MAC address of ? frame 8 Communications Architecture The complexity of the communication task is reduced by using multiple protocol layers: Each protocol is implemented independently Each protocol is responsible for a specific subtask Protocols are grouped in a hierarchy A structured set of protocols is called a communications architecture or protocol suite or stack 9 TCP/IP Protocol Suite The TCP/IP protocol suite is the protocol architecture of the Internet The TCP/IP suite has four layers: Application, Transport, Network, and Data Link Layer End systems (hosts) implement all four layers. Gateways (Routers) only have the bottom two layers. 10 Functions of the Layers Data Link Layer: Service: Reliable transfer of frames over a link Media Access Control on a LAN Functions: Framing, media access control, error checking Network Layer: Service: Move packets from source host to destination host Functions: Routing, addressing Transport Layer: Service: Delivery of data between hosts Functions: Connection establishment/termination, error control, flow control Application Layer: Service: Application specific (delivery of, retrieval of HTML documents, reliable transfer of file) Functions: Application specific 11 Layered Communications An entity of a particular layer can only communicate with: 1. a peer layer entity using a common protocol (Peer Protocol) 2. adjacent layers to provide services and to receive services 12 Layers in the Example 13 Layers in the Example Send HTTP Request to neon Establish a connection to at port 80 Open TCP connection to port 80 Send a datagram (which contains a connection request) to Send IP datagram to Send the datagram to Send Ethernet frame to 00:e0:f9:23:a8:20 Send Ethernet frame to 00:20:af:03:98:28 Send IP data-gram to Send the datagram to Frame is an IP datagram IP datagram is a TCP segment for port 80 14 Layers and Services Service provided by TCP to HTTP: reliable transmission of data over a logical connection Service provided by IP to TCP: unreliable transmission of IP datagrams across an IP network Service provided by Ethernet to IP: transmission of a frame across an Ethernet segment Other services: DNS: translation between domain names and IP addresses ARP: Translation between IP addresses and MAC addresses 15 Encapsulation and Demultiplexing As data is moving down the protocol stack, each protocol is adding layer-specific control information 16 Different Views of Networking Different Layers of the protocol stack have a different view of the network. This is HTTPs and TCPs view of the network. 17 Network View of IP Protocol 18 Network View of Ethernet Ethernets view of the network 19 Address Resolution Protocol (ARP) 20 Overview 21 ARP and RARP Note: The Internet is based on IP addresses Data link protocols (Ethernet, FDDI, ATM) may have different (MAC) addresses The ARP and RARP protocols perform the translation between IP addresses and MAC layer addresses We will discuss ARP for broadcast LANs, particularly Ethernet LANs 22 Processing of IP packets by network drivers 23 Sending a packet from Argon to Neon 24 Address Translation with ARP ARP Request: Argon broadcasts an ARP request to all stations on the network: What is the hardware address of Router137? 25 Address Translation with ARP ARP Reply: Router 137 responds with an ARP Reply which contains the hardware address 26 ARP Cache Since sending an ARP request/reply for each IP datagram is inefficient, hosts maintain a cache (ARP Cache) of current entries. The entries expire after 20 minutes. Contents of the ARP Cache: ( ) at 00:10:4B:C5:D1:15 [ether] on eth0 ( ) at 00:B0:D0:E1:17:D5 [ether] on eth0 ( ) at 00:B0:D0:DE:70:E6 [ether] on eth0 ( ) at 00:05:3C:06:27:35 [ether] on eth1 ( ) at 00:B0:D0:E1:17:DB [ether] on eth0 ( ) at 00:B0:D0:E1:17:DF [ether] on eth0 27 Things to know about ARP What happens if an ARP Request is made for a non-existing host? Several ARP requests are made with increasing time intervals between requests. Eventually, ARP gives up. What if a host sends an ARP request for its own IP address? The other machines respond (gratuitous ARP) as if it was a normal ARP request. This is useful for detecting if an IP address has already been assigned. 28 Proxy ARP Proxy ARP: Host or router responds to ARP Request that arrives from one of its connected networks for a host that is on another of its connected networks. 29 LAN Switching and Bridges 30 Outline Interconnection Devices Bridges/LAN Switches vs. Routers Bridges Learning Bridges Transparent bridges 31 Introduction There are many different devices for interconnecting networks 32 Ethernet Hub Used to connect hosts to Ethernet LAN and to connect multiple Ethernet LANs Collisions are propagated Bridges/LAN switches A bridge or LAN switch is a device that interconnects two or more Local Area Networks (LANs) and forwards packets between these networks. Bridges/LAN switches operate at the Data Link Layer (Layer 2) Terminology: Bridge, LAN switch, Ethernet switch There are different terms to refer to a data-link layer interconnection device: The term bridge was coined in the early 1980s. Today, the terms LAN switch or (in the context of Ethernet) Ethernet switch are used. Convention: Since many of the concepts, configuration commands, and protocols for LAN switches were developed in the 1980s, and commonly use the old term `bridge, we will, with few exceptions, refer to LAN switches as bridges. 34 35 Ethernet Hubs vs. Ethernet Switches An Ethernet switch is a packet switch for Ethernet frames Buffering of frames prevents collisions. Each port is isolated and builds its own collision domain An Ethernet Hub does not perform buffering: Collisions occur if two frames arrive at the same time. HubSwitch 36 Routers Routers operate at the Network Layer (Layer 3) Interconnect IP networks 37 Gateways The term Gateway is used with different meanings in different contexts Gateway is a generic term for routers (Level 3) Gateway is also used for a device that interconnects different Layer 3 networks and which performs translation of protocols (Multi-protocol router) 38 Interconnecting networks: Bridges versus Routers Routers Each hosts IP address must be configured If network is reconfigured, IP addresses may need to be reassigned Routing done via RIP or OSPF Each router manipulates packet header (e.g., reduces TTL field) Bridges/LAN switches MAC addresses of hosts are hardwired No network configuration needed Routing done by learning bridge algorithm spanning tree algorithm Bridges do not manipulate frames 39 Bridges Overall design goal: Complete transparency Plug-and-play Self-configuring without hardware or software changes Bridges should not impact operation of existing LANs Three parts to understanding bridges: (1) Forwarding of Frames (2) Learning of Addresses (3) Spanning Tree Algorithm 40 Need for a forwarding between networks What do bridges do if some LANs are reachable only in multiple hops ? What do bridges do if the path between two LANs is not unique ? 41 Transparent Bridges Three principal approaches can be found: Fixed Routing Source Routing Spanning Tree Routing (IEEE 802.1d) We only discuss the last one in detail. Bridges that execute the spanning tree algorithm are called transparent bridges 42 (1) Frame Forwarding Each bridge maintains a MAC forwarding table Forwarding table plays the same role as the routing table of an IP router Entries have the form ( MAC address, port, age), where MAC address: host name or group address port:port number of bridge age:aging time of entry (in seconds) with interpretation: a machine with MAC address lies in direction of the port number from the bridge. The entry is age time units old. MAC addressportage a0:e1:34:82:ca:34 45:6d:20:23:fe:2e MAC forwarding table 43 Assume a MAC frame arrives on port x. (1) Frame Forwarding Is MAC address of destination in forwarding table for ports A, B, or C ? Forward the frame on the appropriate port Flood the frame, i.e., send the frame on all ports except port x. Found? Not found ? 44 Routing tables entries are set automatically with a simple heuristic: The source field of a frame that arrives on a port tells which hosts are reachable from this port. (2) Address Learning (Learning Bridges) Port 1 Port 2 Port 3 Port 4 Port 5 Port 6 Src=x, Dest=y x is at Port 3 Src=y, Dest=x Src=x, Dest=y y is at Port 4 Src=x, Dest=y 45 Learning Algorithm: For each frame received, the source stores the source field in the forwarding database together with the port where the frame was received. All entries are deleted after some time (default is 15 seconds). (2) Address Learning (Learning Bridges) Port 1 Port 2 Port 3 Port 4 Port 5 Port 6 x is at Port 3 Src=y, Dest=x y is at Port 4 46 Flooding Can Lead to Loops Switches sometimes need to broadcast frames Upon receiving a frame with an unfamiliar destination Upon receiving a frame sent to the broadcast address Broadcasting is implemented by flooding Transmitting frame out every interface except the one where the frame arrived Flooding can lead to forwarding loops E.g., if the network contains a cycle of switches Either accidentally, or by design for higher reliability 47 Solution: Spanning Trees Ensure the topology has no loops Avoid using some of the links when flooding to avoid forming a loop Spanning tree Sub-graph that covers all vertices but contains no cycles 48 Solution: Spanning Trees Ensure the topology has no loops Avoid using some of the links when flooding to avoid forming a loop Spanning tree Sub-graph that covers all vertices but contains no cycles Links not in the spanning tree do not forward frames 49 Constructing a Spanning Tree Need a distributed algorithm Switches cooperate to build the spanning tree and adapt automatically when failures occur Key ingredients of the algorithm Switches need to elect a root The switch with the smallest identifier For each of its interfaces, a switch identifies if the interface is on the shortest path from the root And it excludes an interface from the tree if not 50 Constructing a Spanning Tree (cont. I) root One hop Three hops 51 Constructing a Spanning Tree (cont. II) Use broadcast messages; e.g. (Y, d, X) From node X Claiming Y is the root And the distance from X to root is d 52 Steps in Spanning Tree Algorithm Initially, each switch thinks it is the root Switch sends a message out every interface identifying itself as the root Example: switch X announces (X, 0, X) Switches update their view of the root Upon receiving a message, check the root id If the new id is smaller, start viewing that switch as root Switches compute their distance from the root Add 1 to the distance received from a neighbor Identify interfaces not on a shortest path to the root and exclude them from the spanning tree 53 Example From Switch #4s Viewpoint Switch #4 thinks it is the root Sends (4, 0, 4) message to 2 and 7 Then, switch #4 hears from #2 Receives (2, 0, 2) message from 2 and thinks that #2 is the root And realizes it is just one hop away Then, switch #4 hears from #7 Receives (2, 1, 7) from 7 And realizes this is a longer path So, prefers its own one-hop path And removes 4-7 link from the tree 54 Example From Switch #4s Viewpoint Switch #2 hears about switch #1 Switch 2 hears (1, 1, 3) from 3 Switch 2 starts treating 1 as root And sends (1, 2, 2) to neighbors Switch #4 hears from switch #2 Switch 4 starts treating 1 as root And sends (1, 3, 4) to neighbors Switch #4 hears from switch #7 Switch 4 receives (1, 3, 7) from 7 And realizes this is a longer path So, prefers its own three-hop path And removes 4-7 Iink from the tree 55 Robust Spanning Tree Algorithm Algorithm must react to failures Failure of the root node Need to elect a new root, with the next lowest identifier Failure of other switches and links Need to recompute the spanning tree Root switch continues sending messages Periodically reannouncing itself as the root (1, 0, 1) Other switches continue forwarding messages Detecting failures through timeout (soft state!) Switch waits to hear from others Eventually times out and claims to be the root Spanning Tree Protocol (IEEE 802.1d) The Spanning Tree Protocol (SPT) is a solution to prevent loops when forwarding frames between LANs The SPT is standardized as the IEEE 802.1d protocol The SPT organizes bridges and LANs as spanning tree in a dynamic environment Frames are forwarded only along the branches of the spanning tree Note: Trees dont have loops Bridges that run the SPT are called transparent bridges Bridges exchange messages to configure the bridge (Configuration Bridge Protocol Data Unit or BPDUs) to build the tree. 56 57 Configuration BPDUs 58 What do the BPDUs do? With the help of the BPDUs, bridges can: Elect a single bridge as the root bridge. Calculate the distance of the shortest path to the root bridge Each LAN can determine a designated bridge, which is the bridge closest to the root. The designated bridge will forward packets towards the root bridge. Each bridge can determine a root port, the port that gives the best path to the root. Select ports to be included in the spanning tree. 59 Concepts Each bridge as a unique identifier:Bridge ID Bridge ID = Priority : 2 bytes Bridge MAC address: 6 bytes Priority is configured Bridge MAC address is lowest MAC addresses of all ports Each port of a bridge has a unique identifier (port ID). Root Bridge: The bridge with the lowest identifier is the root of the spanning tree. Root Port:Each bridge has a root port which identifies the next hop from a bridge to the root. 60 Concepts Root Path Cost: For each bridge, the cost of the min-cost path to the root. Designated Bridge, Designated Port: Single bridge on a LAN that provides the minimal cost path to the root for this LAN: - if two bridges have the same cost, select the one with highest priority - if the min-cost bridge has two or more ports on the LAN, select the port with the lowest identifier Note: We assume that cost of a path is the number of hops. 61 Steps of Spanning Tree Algorithm Each bridge is sending out BPDUs that contain the following information: The transmission of BPDUs results in the distributed computation of a spanning tree The convergence of the algorithm is very quick 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 62 Ordering of Messages We define an ordering of BPDU messages We say M1 advertises a better path than M2 (M1