Download presentation
Presentation is loading. Please wait.
1
CSS432 Basic Internetworking Textbook Ch3.2
Prof. Athirai Irissappane CSS432: Basic Internetworking
2
You are here CSS432: Internetworking
3
The University of Adelaide, School of Computer Science
5 June 2018 Internetworking 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 Chapter 2 — Instructions: Language of the Computer
4
CSS432: Basic Internetworking
IP Internet Interconnected Collection of Networks Viewed as a simple logical network Routers: nodes interconnecting networks Protocol Stack IP on all nodes (both hosts and router) TCP and UDP on top of IP R2 R1 H4 H5 H3 H2 H1 Network 2 (Ethernet) Network 1 (Ethernet) H6 Network 3 (FDDI) Network 4 (point-to-point) H7 R3 H8 R1 ETH FDDI IP TCP R2 PPP R3 H1 H8 Identical packet Identical datagram Identical datagram Identical frame Identical frame CSS432: Basic Internetworking
5
The University of Adelaide, School of Computer Science
5 June 2018 IP Service Model Packet Delivery Model Connectionless model for data delivery Best-effort delivery (unreliable service) packets are lost packets are delivered out of order duplicate copies of a packet are delivered packets can be delayed for a long time Global Addressing Scheme Provides a way to identify all hosts in the network Chapter 2 — Instructions: Language of the Computer
6
The University of Adelaide, School of Computer Science
5 June 2018 Packet Format Version (4): currently 4 Hlen (4): number of 32-bit words in header, length of header TOS (8): type of service (not widely used) Length (16): number of bytes in this datagram (header + data) Ident (16): used by fragmentation Flags/Offset (16): used by fragmentation TTL (8): number of hops this datagram has traveled Protocol (8): demux key (TCP=6, UDP=17) Checksum (16): of the header only DestAddr & SrcAddr (32 bits)(4 bytes) Chapter 2 — Instructions: Language of the Computer
7
CSS432: Basic Internetworking
Service Model Sent from IP to lower layers Lower layers attach their own headers IP packet (32 bit/4 byte boundary) (Each row/word 32 bit, i.e., 0-31) Header length mostly 5 rows= 5 * 4byte = 20 bytes; (options are not set most time) Max size of IP datagram packet = 2^16 = 65535 Length is 16 bit field frame type Ex. Ethernet preamble dest addr src addr 0x0800 CRC V ersion HLen TOS Length Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 4 8 16 19 31 Data Length represented as 16 bits. Represents size of datagram + header. Thus max size of IP datagram = MTU = 2^16 = 65535 CSS432: Basic Internetworking
8
IP Fragmentation and Reassembly
The University of Adelaide, School of Computer Science 5 June 2018 IP Fragmentation and Reassembly Each network has some MTU (Maximum Transmission Unit) Largest IP datagram it can carry in its frame Max size of payload of the network Ethernet (1500 bytes), FDDI (4500 bytes), IP datagram < = MTU of link layer IP header + IP data < = MTU of link layer Strategy Fragmentation occurs in a router when it receives a datagram that it wants to forward over a network which has (MTU < datagram) Reassembly is done at the receiving host All fragments carry same identifier in the Ident field (determined by sender) Fragments are self-contained datagrams IP does not recover from missing fragments Chapter 2 — Instructions: Language of the Computer
9
IP Fragmentation and Reassembly - E.g., Transmit 1400 bytes
The University of Adelaide, School of Computer Science 5 June 2018 IP Fragmentation and Reassembly - E.g., Transmit 1400 bytes IP datagrams traversing the sequence of physical networks Ethernet MTU (1500), PPP MTU in this case 532 bytes 376 Chapter 2 — Instructions: Language of the Computer
10
IP Fragmentation and Reassembly
The University of Adelaide, School of Computer Science 5 June 2018 IP Fragmentation and Reassembly Header fields used in IP fragmentation. (a) Unfragmented packet; (b) fragmented packets. Seq number of 8-byte chunks 175*8=1400 =888 =376 Chapter 2 — Instructions: Language of the Computer
11
IP Fragmentation and Reassembly
The University of Adelaide, School of Computer Science 5 June 2018 IP Fragmentation and Reassembly every fragment except the last must contain a multiple of 8 bytes of data Transmit x bytes of data, if x is > MTU > 532 If 20 bytes of IP header 1st fragment Data size1 = Min (multiple of 8 closest to MTU-20, x) = Min(512,1400) Offset1 = 0 Ident =x (identifier for chunks of the same packet) M Flag = 1 (more fragments follow) 2nd fragment Data size2 = Min (multiple of 8 closest to MTU-20, x-data size1) = Min(512, ) Offset2 = data size1 / = 512/8 3rd fragment Data size3 = Min (multiple of 8 closest to MTU-20, x-data size1-data size2) 376 = Min(512,1400 – ) Offset2 = (data size1 + data size 2) / = ( )/8 M Flag =0 (more fragments follow) Chapter 2 — Instructions: Language of the Computer
12
Fragmentation and Reassembly
Each network has some MTU (maximum transmission unit) To check each interface of your computer: netstat –i ifconfig Strategy fragment when necessary (MTU < Datagram) try to avoid fragmentation at source host re-fragmentation is possible fragments are self-contained datagrams delay reassembly until destination host do not recover from lost fragments CSS432: Basic Internetworking
13
Global Addresses IP address globally unique, 32 bits, 4 bytes long
hierarchical: network part + host part 4 Billion IP address, half are A type, ¼ is B type, and 1/8 is C type Network Host 7 24 A: 14 16 1 B: 21 8 C: MAC address – 6 bytes 48 bits long
14
Global Addresses IP address Class
Network Host 7 24 A: 14 16 1 B: 21 8 C: Global Addresses IP address Class Identified using first few bits as shown in fig Class A (previously reserved for small number of WAN) 7 bits for network, 24 bits for host 2^7 – 2 different networks (1st bit is 0, 127… is reserved for loopback IP address) Each network 2^24 -2 hosts (all zeros in host bits represent network ID, all 1s broadcast Id) (2^24 – 2 = 16,777,214) Class B (previously reserved for medium sized campus networks) 14 bits for network, 16 bits for host 2^14 networks Each network 2^ hosts ( = 65534) Class C (previously reserved for large number of LANs) 21 bits for network, 8 bits for host (2^8 -2) = (256-2=254) But convention not followed anymore – Classless addresses are used now MAC address – 6 bytes 48 bits long
15
CSS432: Basic Internetworking
Global Addresses Dot Notation Class A – ( – , , , and – reserved) Class B – Class C – Network Host 7 24 A: 14 16 1 B: 21 8 C: MAC address – 6 bytes 48 bits long CSS432: Basic Internetworking
16
IP Datagram Forwarding
The University of Adelaide, School of Computer Science 5 June 2018 IP Datagram Forwarding How routers forward IP datagrams in internetwork every datagram contains destination's address if directly connected to destination network, i.e., in the same network, then forward to host using its own interface Check if the network portion of destination address is the same as the network portion of the sender’s address if not directly connected to destination network, then forward to some router Every node will have a choice of several routers (they can maintain a forwarding table) Choose the best one/reasonable one capable of delivering datagram atleast close to the destination Default router can also be used for a particular router forwarding table of router maps network number into next hop, i.e., what is the next hop for a particular destination If network number not present in forwarding table then use default router Routers can have multiple interfaces (hosts mostly have 1 interface) Include entry for networks directly connected to the interfaces Chapter 2 — Instructions: Language of the Computer
17
IP Datagram Forwarding
The University of Adelaide, School of Computer Science 5 June 2018 IP Datagram Forwarding Example R1 R2 R3 Network# Next hop 1 R2 2 Interface1 3 Interface0 4 Network# Next hop 1 R3 2 R1 3 Interface1 4 Interface0 Network# Next hop 1 Interface0 2 R2 3 4 Interface1 R1 R2 R3 H1 H8 Network 4 Network 3 Network 2 Network 1 i/f 0 i/f 1 Chapter 2 — Instructions: Language of the Computer
18
IP Datagram Forwarding
The University of Adelaide, School of Computer Science 5 June 2018 IP Datagram Forwarding Algorithm if (NetworkNum of destination = NetworkNum of one of my interfaces) then deliver packet to destination over that interface else if (NetworkNum of destination is in my forwarding table) then deliver packet to NextHop router deliver packet to default router For a host with only one interface and only a default router in its forwarding table, this simplifies to if (NetworkNum of destination = my NetworkNum)then deliver packet to destination directly Chapter 2 — Instructions: Language of the Computer
19
Static Configuration for Cisco Routers
/24 /24 /24 /24 /24 Eth2: Eth1: Eth0: Eth1: Eth0: Eht0: Eth1: hostname router1 ! interface ethernet 0 ip address interface ethernet 1 ip address ip route ip route ip route Routers forward packets using either route information from route table entries that you manually configure or the route information that is calculated using dynamic routing algorithms. Static routes, which define explicit paths between two routers, cannot be automatically updated; you must manually reconfigure static routes when network changes occur. Static routes use less bandwidth than dynamic routes CSS432: Basic Internetworking
20
CSS432: Basic Internetworking
hostname router1 ! interface ethernet 0 ip address // set ip address of Ethernet with subnet mask interface ethernet 1 ip address // set ip address of Ethernet with subnet mask ip route // for destination network ip with subnet mask set the next hop ip route ip route CSS432: Basic Internetworking
21
Address Translation Protocol (ARP)
The University of Adelaide, School of Computer Science 5 June 2018 Address Translation Protocol (ARP) When host find that network portion of address matches with the destination, it can send packets though its own interface Needs to know the physical address of the destination host/ next hop router Send them through Ethernet/wifi (direct connection) Map IP addresses into physical addresses Physical address destination host Physical address of next hop router Techniques encode physical address in host part of IP address Maintain table-based Chapter 2 — Instructions: Language of the Computer
22
CSS432: Basic Internetworking
Address Translation Map IP addresses into physical addresses destination host next hop router Techniques encode physical address in host part of IP address Pha = f( IPa) or IPa =f-1(Pha) Pha: => = 33 =81 Class B address: 16 bits for host part Problems Class C has only 8 bits to indicate a host Ethernet has 48 bits to present a host address : => = 33 =81 Ip address 32 bits 16 bits for host address (class B), Class c 8 bits CSS432: Basic Internetworking
23
Address Translation Protocol (ARP)
The University of Adelaide, School of Computer Science 5 June 2018 Address Translation Protocol (ARP) ARP (Address Resolution Protocol) Resolution through dynamic binding table of IP address to physical address bindings at each host broadcast request if IP address not in table target machine responds with its physical address table entries are discarded (after particular time) Physical address address can change because of a broken NIC Dynamic Ip addressing Table entries are refreshed when updated, i.e., their expiry time is extended Chapter 2 — Instructions: Language of the Computer
24
CSS432: Basic Internetworking
ARP Details table entries timeout in about 15 minutes Update table with source when you are the target, otherwise no need to add an entry update table if already have an entry A broadcasts ARP request about IP address of B The request contains IP address and Mac address of A B receives the request makes an entry for A in its ARP table and sends back its physical address Refreshes entry for A if already present Other nodes may/may not include an entry for A in their table Reuqest I’m IPa and Pha. You’re IPb. How about Ph? A X B Y IP Ph IPa Pha IPb ?? IP Ph IPb Phb Response I’m IPb and Phb. You’re IPa and Pha A X B Y IP Ph IPa Pha IPb Phb IP Ph IPb Phb IPa Pha CSS432: Basic Internetworking
25
CSS432: Basic Internetworking
ARP Packet Format An ARP packet is carried in a frame header HardwareType: type of physical network (e.g., Ethernet) ProtocolType: type of higher layer protocol (e.g., IP) requesting this HLEN & PLEN: length of physical and protocol addresses Operation: request or response Source/Target-Physical/Protocol addresses frame type Ex. Ethernet preamble dest addr src addr 0x0806 CRC T argetHardwareAddr (bytes 2 – 5) argetProtocolAddr (bytes 0 3) SourceProtocolAddr (bytes 2 Hardware type = 1 ProtocolT ype = 0x0800 SourceHardwareAddr (bytes 4 argetHardwareAddr (bytes 0 1) SourceProtocolAddr (bytes 0 HLen = 48 PLen = 32 Operation SourceHardwareAddr (bytes 0 8 16 31 CSS432: Basic Internetworking
26
RARP: Reverse Address Resolution Protocol
ARP assumes each host know their IP & MAC Clients like diskless workstation do not know IP address IP address necessary for communication at IP layer RARP Servers maintain mappings from MAC to IP Broadcast RARP request Works in the same LAN Retransmit an RARP message after a large delay if it has been lost. Prepare a primary and secondary server. Request I’m Pha. What’s my IPa? A X B Y RARP server IP Ph ?? Pha IP Ph IPa Pha IPb Phb Response You’re IPa and Pha A diskless node (or diskless workstation) is a workstation or personal computer without disk drives, which employs network booting to load its operating system from a server. (A computer may also be said to act as a diskless node, if its disks are unused and network booting is used.) A X B Y RARP server IP Ph IPa Pha IP Ph IPa Pha IPb Phb CSS432: Basic Internetworking
27
CSS432: Basic Internetworking
RARP Disadvantage Using a computer’s MAC address which does not allow mobile computers to move to another network Operating at data-link level which requires direct access to the network hardware Not working beyond routers, because routers are IP-based but RAPS are not IP. RARP request include only MAC address so cannot be deliver to server not in the same network CSS432: Basic Internetworking
28
The University of Adelaide, School of Computer Science
5 June 2018 Host Configurations Notes Ethernet addresses are configured into network by manufacturer and they are unique IP addresses must be unique on a given internetwork but also must reflect the structure of the internetwork Most host Operating Systems provide a way to manually configure the IP information for the host Drawbacks of manual configuration A lot of work to configure all the hosts in a large network Configuration process is error-prune Automated Configuration Process is required Chapter 2 — Instructions: Language of the Computer
29
Dynamic Host Configuration Protocol (DHCP)
The University of Adelaide, School of Computer Science 5 June 2018 Dynamic Host Configuration Protocol (DHCP) DHCP server is responsible for providing configuration information to hosts There is at least one DHCP server for an administrative domain Admin can assign IP-MAC mapping and store it in DCHP When host boot or join network they can contact DCHP server for IP Still lot of work for admin Chapter 2 — Instructions: Language of the Computer
30
Dynamic Host Configuration Protocol (DHCP)
The University of Adelaide, School of Computer Science 5 June 2018 Dynamic Host Configuration Protocol (DHCP) DHCP server maintains a pool of available addresses Admin assigns range of IP address to the DCHP server DCHP assigns IP address to host on demand IP address cannot be changed frequently Host crash, system failure Unused IP address must be returned back Lease IP address for certain period, renew it Chapter 2 — Instructions: Language of the Computer
31
Where to find DHCP server?
The University of Adelaide, School of Computer Science 5 June 2018 Where to find DHCP server? 1 DHCP server per network hard to maintain 1 Relay agent per network Relays incoming query message to DCHP server Newly booted or attached host sends DHCPDISCOVER message, to a special IP address , which is the broadcast address DHCP relay agent unicasts the message to DHCP server and waits for the response Relay agent sends back the information to client UDP protocol for message transfer Chapter 2 — Instructions: Language of the Computer
32
CSS432: Basic Internetworking
DHCP Options Boot file name Server host name Client Hardware addr Router IP aaddr Server IP addr Your IP addr Client IP addr Flags Secs Xid HOPS HLEN Htype OP BOOTP/DHCP UDP header datagram Frame addr DHCP server: Works as a centralized repository for IPs Pools available IP addresses Hands out one to a client on demand Accessible by sending a DHCPDISCOVER message to an IP broadcast address Receives a DHCPDISCOVER from a Relay agent connected to a different network Advantages: Works at a user level Automatic IP configuration Save IP addresses Works across networks. Frame Format Your IP IP address filled by DCHP, Client Hardware address filled by client Options: filled with default router information for the client CSS432: Basic Internetworking
33
DHCP Client State Transition
INITIALIZE Host boots / DHCPDISCOVER to all servers SELECT DHCPNACK DHCPNACK Or Lease expires Receive DHCPOFFER from all servers Lease reaches 87.5% expiration – T2 / DHCPREQUEST to any server REBIND RENEW Select offer / DHCPREQUEST to a specific server DHCPACK REQUEST DHCPACK Lease reaches 50% expiration – T1 / DHCPREQUEST to the current server Receive DHCPACK from the current server BOUND CSS432: Basic Internetworking
34
DHCP Client State Transition Diaram
The University of Adelaide, School of Computer Science 5 June 2018 DHCP Client State Transition Diaram INITIALIZE – Process of acquiring lease. Client Sends DHCPDISCOVER: The client creates a DHCPDISCOVER message and broadcasts it to try to find a DHCP server. SELECT - The client is waiting to receive DHCPOFFER messages from one or more DHCP servers REQUEST - The client is waiting to hear back from the server to which it sent its request. client receives a DHCPACK message from its chosen server which contains IP address, checks it is not already used. Sets lease timers T1, T2 DCHP sever first check if the IP address is in use using the ICMP echo message then assigns it to the client The renewal timer (T1) goes off to tell the client it is time to try to renew the lease with the server that initially granted it. The rebinding timer (T2) goes off if the client is not successful in renewing with that server, and tells it to try any server to have the lease extended. If the lease is renewed or rebound, the client goes back to normal operation. If it cannot be rebound, it will expire and the client will need to seek a new lease. INIT-REBOOT - client already has a valid lease starts up after a power-down or reboot, it starts here instead of the INIT state. sends a DHCPREQUEST message to attempt to verify its lease and re-obtain its configuration parameters. Chapter 2 — Instructions: Language of the Computer
35
DHCP Client State Transition Diagram
The University of Adelaide, School of Computer Science 5 June 2018 DHCP Client State Transition Diagram BIND - Client has a valid lease and is in its normal operating state. Renewal Timer (T1) Expires: The client transitions to the RENEW state. Client Terminates Lease, Sends DHCPRELEASE, returns to the INITIALIZE state. RENEW trying to renew its lease. It regularly sends DHCPREQUEST messages with the server that gave it its current lease specified, and waits for a reply. Client Receives DHCPACK: The client receives a DHCPACK reply to its DHCPREQUEST. Its lease is renewed, it restarts the T1 and T2 timers, and returns to the BOUND state. Client Receives DHCPNAK: The server has refused to renew the client's lease. The client goes to the INIT state to get a new lease Rebinding Timer (T2) Expires: While attempting to renew its lease, the T2 timer expires, indicating that the renewal period has ended. The client transitions to the REBIND state REBOOTING - client that has rebooted with an assigned address is waiting for a confirming reply from a server Client Receives DHCPACK, Successfully Checks That IP Address Is Free – moves to BOUND state Client Receives DHCPACK, But IP Address Is In Use (client uses ARP protocol). finds that while the client was offline, some other device has grabbed its leased IP address. The client sends a DHCPDECLINE message back to the server, and returns to the INIT state to obtain a new lease. Client Receives DHCPNAK current lease is no longer valid; for example, the client may have moved to a new network where it can no longer use the address in its present lease. The client returns to the INIT state Chapter 2 — Instructions: Language of the Computer
36
The University of Adelaide, School of Computer Science
5 June 2018 REBIND: client has failed to renew its lease seeks a lease extension with any server that can hear it. It periodically sends DHCPREQUEST messages with no server specified until it gets a reply or the lease ends. Client Receives DHCPACK: Some server on the network has renewed the client's lease. Client Receives DHCPNAK: A server on the network is specifically telling the client it needs to restart the leasing process. – INIT state Lease Expires: The client receives no reply prior to the expiration of the lease. It goes back to the INITIALIZE state. Chapter 2 — Instructions: Language of the Computer
37
Internet Control Message Protocol (ICMP)
The University of Adelaide, School of Computer Science 5 June 2018 Internet Control Message Protocol (ICMP) Defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully Destination host unreachable due to link /node failure Reassembly process failed TTL had reached 0 (so datagrams don't cycle forever) IP header checksum failed ICMP-Redirect Message From router to a source host if it finds that there exists a better route for the packet sent to the current router from the source With a better route information PING and TRACEROUTE use ICMP PING uses ICMP echo messages to determine if a node is reachable and alive Chapter 2 — Instructions: Language of the Computer
38
Internet Control Message Protocol
The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, like routers, to send error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached.[1] CSS432: Internetworking
39
Internet Control Message Protocol (ICMP)
An error reporting message (ICMP) Error occurred Src R1 R2 R3 RK Rcv Is Src responsible for this ICMP message? RE Mistakenly routed ICMP type 0-18 ICMP ICMP header ICMP data IP datagram heaader Data Link frame header CSS432: Internetworking
40
ICMP Message Header http://nmap.org/book/tcpip-ref.html
CSS432: Internetworking
41
CSS432: Basic Internetworking
ICMP Message Types Type field Code field ICMP Message Type Applications 0 and 8 Echo reply/request ping 3 Destination unreachable 5 Redirect (change a route) 11 TTL exceeded Trace route, 1 Fragment reassemble failed In computing, traceroute is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host (remote node) in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection. CSS432: Basic Internetworking
42
CSS432: Basic Internetworking
Ping Uses Echo Request Reply: checking if they are capable of sending datagrams to each other Device A begins the test process by sending an ICMPv4 Echo message to B. Device B, when it receives the Echo, responds back to Device A with an Echo Reply message. CSS432: Basic Internetworking
43
CSS432: Basic Internetworking
Reviews IP Internet: Protocol stack, fragmentation/reassembly, IP address, and datagram forwarding Address translation: ARP, RAPR, and DHCP ICMP Exercises in Chapter 3 Ex. 36 (fragmentation) CSS432: Basic Internetworking
44
CSS432: Basic Internetworking
More Exercises (not from Our Textbook) Q1. (DHCP) Consider a host that has a disk and uses DHCP to obtain an IP address. If the host stores its address on disk along with the data the lease expires, and then reboots within the lease period, can it use the same address Assume that the client’s boot/reboot always starts from “INITIALIZE”? Why or why not? Q2. (DHCP) DHCP mandates a minimum address lease of one hour. Can you imagine a situation in which DHCP’s minimum lease causes inconvenience? Explain. CSS432: Basic Internetworking
45
CSS432: Basic Internetworking
Supplementary slides In computing, traceroute is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host (remote node) in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection. CSS432: Basic Internetworking
46
Two-Step bootstrap Procedure
BOOTP server Step 1A: BOOTP request: BOOT FILE NAME=I want to boot “unix” Diskless Workstation Step 1B: BOOTP reply: Server = mercury, BOOT FILE NAME=“/local/var/bootfiles/xncd19r” Step 2A: TFTP request: request for the image File server A diskless node (or diskless workstation) is a workstation or personal computer without disk drives, which employs network booting to load its operating system from a server. (A computer may also be said to act as a diskless node, if its disks are unused and network booting is used.) Step 2B: TFTP reply: image returned OS Image: Unix Windows CSS432: Basic Internetworking
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.