Download presentation
Presentation is loading. Please wait.
Published byAlexander Flynn Modified over 9 years ago
1
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 6.2: IP Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 1
2
Internetworking: Discussions Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 2 For Internetworking, we shall look at few sub- problems: Interconnect links of the same type: Switches We consider an important of class switch: Bridges to interconnect Ethernet segments. We also look a way to interconnect disparate networks and links: Gateways, or now mostly known as routers. We shall focus on the IP Once we are able to interconnect a whole lot of links and networks with switches and routers, we will look at a way to find a suitable path, or route through a new working: Paths that are efficient, loop free, etc.: Routing
3
Internetworking Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 3 What is internetwork – An arbitrary collection of networks interconnected to provide some sort of host-host to packet delivery service A simple internetwork where H represents hosts and R represents routers
4
IP: Internet Protocol Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 4 What is IP – IP stands for Internet Protocol – Key tool used today to build scalable, heterogeneous internetworks – It runs on all the nodes in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork A simple internetwork showing the protocol layers
5
IP: “Best Effort” Service Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 5 IP is a datagram connectionless protocol Does not provide any type of guarantee about packet delivery – Out of order packet deliveries, duplicate packets, no error correction If packets are lost, IP does not try to recover or retransmit (though lower or higher layer functionalities may do so) Global addressing scheme
6
IPv4: Packet Format Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 6 4-bit Version 4-bit Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload
7
IP Packet Format Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 7 Version number (4 bits) Indicates the version of the IP protocol Necessary to know what other fields to expect Typically “4” (for IPv4), and sometimes “6” (for IPv6) Header length (4 bits) Number of 32-bit words in the header Typically “5” (for a 20-byte IPv4 header) Can be more when “IP options” are used Type-of-Service (8 bits) Allow packets to be treated differently based on needs E.g., low delay for audio, high bandwidth for bulk transfer
8
IP Packet Format Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 8 Total length (16 bits) Number of bytes in the packet Maximum size is 63,535 bytes (2 16 -1) … though underlying links may impose harder limits Fragmentation information (32 bits) Packet identifier, flags, and fragment offset Supports dividing a large IP packet into fragments … in case a link cannot handle a large IP packet Time-To-Live (8 bits) Used to identify packets stuck in forwarding loops … and eventually discard them from the network
9
Time-to-Live (TTL) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 9 Potential robustness problem Forwarding loops can cause packets to cycle forever Confusing if the packet arrives much later Time-to-live field in packet header TTL field decremented by each router on the path Packet is discarded when TTL field reaches 0… …and “time exceeded” message is sent to the source
10
Protocol Field Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 10 Protocol (8 bits) Identifies the higher-level protocol E.g., “6” for the Transmission Control Protocol (TCP) E.g., “17” for the User Datagram Protocol (UDP) Important for demultiplexing at receiving host Indicates what kind of header to expect next IP header TCP headerUDP header protocol=6 protocol=17
11
IP Addresses Field Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 11 Two IP addresses Source IP address (32 bits) Destination IP address (32 bits) Destination address Unique identifier for the receiving host Allows each node/router to make forwarding decisions Source address Unique identifier for the sending host Recipient can decide whether to accept packet Enables recipient to send a reply back to source
12
IP Fragmentation and Reassembly Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 12 Each network has some MTU (Maximum Transmission Unit): largest IP datagram it can carry in a frame – Ethernet (1500 bytes), FDDI (4500 bytes) Strategy – Fragmentation occurs in a router when it receives a datagram that it wants to forward over a network which has (MTU < received datagram) – Reassembly is done at the receiving host – All the fragments carry the same identifier in the Ident field – Fragments are self-contained datagrams – IP does not recover from missing fragments
13
IP Fragmentation and Reassembly Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 13 IP datagrams traversing the sequence of physical networks
14
IP Fragmentation and Reassembly Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 14 Header fields used in IP fragmentation. (a) Unfragmented packet; (b) fragmented packets.
15
IP Datagram Forwarding Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 15 Strategy – every datagram contains destination's address – if directly connected to destination network, then forward to host – if not directly connected to destination network, then forward to some router – forwarding table maps network number into next hop – each host has a default router – each router maintains a forwarding table
16
Forwarding Table Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 16
17
IPv4 Addressing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 17 A unique 32-bit number Identifies an interface (on a host, on a router, …) Represented in dotted-quad notation 0000110000100010 1001111000000101 12341585
18
IPv4 Addressing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 18 A host usually has a single link into network: When IP in host wants to send datagram, it does so over the link -> Boundary between host and link: interface. IP address: technically associated with an interface, rather with the host How about a router? Receive datagram on a link and forward to on some other link. How many interfaces? How many IP addresses?
19
IPv4: Early Addressing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 19 Properties – globally unique – hierarchical: network + host – 4 Billion IP address, half are A type, ¼ is B type, and 1/8 is C type Format Dot notation – 10.3.2.4 – 128.96.33.81 – 192.12.69.77
20
IP Addressing: CIDR Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 20 CIDR: Classless InterDomain Routing – subnet portion of address of arbitrary length – address format: a.b.c.d/x, where x is # bits in subnet portion of address 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23
21
Subnets Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 21 IP address: – subnet part (high order bits) – host part (low order bits) What’s a subnet ? – device interfaces with same subnet part of IP address – can physically reach each other without intervening router 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 network consisting of 3 subnets subnet
22
Subnet and Subnet Mask Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 22 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Recipe to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet. Subnet mask: /24 Or 255.255.255.000
23
Subnets Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 23 How many? 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2 223.1.2.1 223.1.2.6 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2
24
ARP: Address Resolution Protocol Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 24 Each IP node (host, router) on LAN has ARP table in ARP module ARP table: IP/MAC address mappings for some LAN nodes – TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of B knowing B’s IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88
25
ARP: Same LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 25 A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address – dest MAC address = FF-FF- FF-FF-FF-FF – all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address – frame sent to A’s MAC address (unicast) A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ARP is “plug-and-play”: – nodes create their ARP tables without intervention from net administrator
26
ARP: Packet Format Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 26 – HardwareType: type of physical network (e.g., Ethernet) – ProtocolType: type of higher layer protocol (e.g., IP) – HLEN & PLEN: length of physical and protocol addresses – Operation: request or response – Source/Target Physical/Protocol addresses
27
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 27 walkthrough: send datagram from A to B via R. – focus on addressing - at both IP (datagram) and MAC layer (frame) – assume A knows B’s IP address – How can A know whether B is in the same subnet/network? – assume A knows B’s MAC address (how?) – assume A knows IP address of first hop router, R (how?) – assume A knows MAC address of first hop router interface (how?) – How many MAC addresses? R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B
28
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 28 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A IP Eth Phy IP src: 111.111.111.111 IP dest: 222.222.222.222 A creates IP datagram with IP source A, destination B A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B
29
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 29 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A IP Eth Phy frame sent from A to R IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP Eth Phy frame received at R, datagram removed, passed up to IP 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B
30
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 30 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B A IP src: 111.111.111.111 IP dest: 222.222.222.222 R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy
31
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 31 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B A R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy
32
Addressing: Routing to another LAN Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 32 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B A R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy
33
IP Addresses: How to get one? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 33 – MAC address: configured in adapter, globally unique – IP address: Not only be unique on a given internetwork, but needs to reflect the structure of the internetwork Not possible to be configured once into host; Hosts might change to another network: IP needs to be reconfigurable – Usually, automatic configuration methods are required: Dynamic Host Configuration Protocol (DHCP): Textbook, 3.2.7
34
A day in the life: Connecting to Internet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 34 Comcast network 68.80.0.0/13 Google’s network 64.233.160.0/19 64.233.169.105 web server DNS server school network 68.80.2.0/24 browser web page
35
A day in the life: Connecting to Internet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 35 connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP router (runs DHCP) DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.1 Ethernet Ethernet frame broadcast (dest: FFFFFFFFFFFF ) on LAN, received at router running DHCP server Ethernet demuxed to IP demuxed, UDP demuxed to DHCP
36
A day in the life: Connecting to Internet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 36 DHCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server router (runs DHCP) DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router DHCP client receives DHCP ACK reply
37
A day in the life: ARP (before DNS, HTTP) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 37 before sending HTTP request, need IP address of www.google.com: DNS DNS UDP IP Eth Phy DNS DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. In order to send frame to router, need MAC address of router interface: ARP ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router, so can now send frame containing DNS query ARP query Eth Phy ARP ARP reply
38
NAT Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 38 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 local network (e.g., home network) 10.0.0/24 rest of Internet Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers
39
NAT Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 39 Implementation: NAT router must: – outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr. – remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair – incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table
40
NAT Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 40 10.0.0.1 10.0.0.2 10.0.0.3 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 10.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345
41
NAT: Network Address Translation Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 41 NAT is controversial: – routers should only process up to layer 3 – violates end-to-end argument: Hosts should be talking directly with each other, without interfereing nodes modifying IP addresses and port numbers – Address shortage should instead be solved by IPv6 But like it or not, NAT becomes an important component of the Internet
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.