120 likes | 257 Views
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one interface IP addresses associated with each interface. 223.1.1.2. 223.1.2.2. 223.1.2.1. 223.1.3.2.
E N D
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.1.2 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 IP Addressing: introduction 223.1.1.1 223.1.2.9 223.1.1.4 223.1.1.3 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 Network Layer
IP protocol version number 32 bits total datagram length (bytes) header length (bytes) type of service head. len ver length for fragmentation/ reassembly fragment offset “type” of data flgs 16-bit identifier max number remaining hops (decremented at each router) upper layer time to live header checksum 32 bit source IP address 32 bit destination IP address upper layer protocol to deliver payload to E.g. timestamp, record route taken, specify list of routers to visit. Options (if any) data (variable length, typically a TCP or UDP segment) IP datagram format Network Layer
Class Handouts…(provided in class) Network Layer
Solve… • A software company has 100 employees. • What would be the ideal class from which the company would choose its network IP to prevent wastage of IP addresses? • How many bits would be assigned for network part and how many bits would be assigned for host part? • Note a network chosen by a company can not be chosen by any other company. • The company suddenly goes through increase in number of employees from 100 to 2000. • How many network addresses should the company choose and from which class to avoid wastage of IP addresses? Network Layer
What is the solution? • A company starts out with one class C LAN… • As it requires more than 254 machines, one class C LAN is not sufficient • Choices? • Choose one class B • Is it efficient? • Choose multiple class C Network Layer
What is the impact of this solution? • Advantages • Certainly able to minimize the IP address wastage • Disadvantages • Increased number of distinct local networks inside the same company • Managing is tough • Moving machines across the local networks Network Layer
What can be a potential solution? Network Layer
host part network part 11001000 0001011100010000 00000000 200.23.16.0/23 IP addressing: CIDR CIDR:Classless InterDomain Routing • network portion of address of arbitrary length • address format: a.b.c.d/x, where x is # bits in network portion of address Network Layer
Solve… • Now the company decided to go with the CIDR mechanism for 2000 employees. • What would be the ideal network address to minimize wastage of IP addresses? • How many bits in network part and how many bits in host part are there? Network Layer
DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on”) Support for mobile users who want to join network (more shortly) DHCP overview: • host broadcasts “DHCP discover” msg [optional] • DHCP server responds with “DHCP offer” msg [optional] • host requests IP address: “DHCP request” msg • DHCP server sends address: “DHCP ack” msg Network Layer
E B A DHCP client-server scenario 223.1.2.1 DHCP 223.1.1.1 server 223.1.1.2 223.1.2.9 223.1.1.4 223.1.2.2 arriving DHCP client needs address in this network 223.1.1.3 223.1.3.27 223.1.3.2 223.1.3.1 Network Layer
DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP client-server scenario arriving client DHCP server: 223.1.2.5 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs Network Layer