Network Layer/IP Protocols

Similar documents
IP Addresses McGraw-Hill The McGraw-Hill Companies, Inc., 2000

McGraw-Hill The McGraw-Hill Companies, Inc., 2000

LECTURE -4 IP ADDRESSES. IP Addresses: Classful Addressing

Tutorial 9. SOLUTION Since the number of supported interfaces is different for each subnet, this is a Variable- Length Subnet Masking (VLSM) problem.

CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid. Internet Protocol Suite

Network Layer PREPARED BY AHMED ABDEL-RAOUF

The identifier used in the IP layer of the TCP/IP protocol suite to identify each device connected to the Internet is called the Internet address or

TSIN02 - Internetworking

b. Suppose the two packets are to be forwarded to two different output ports. Is it

CIS-331 Final Exam Spring 2016 Total of 120 Points. Version 1

NETWORK LAYER: IP Addressing

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

CIS-331 Final Exam Fall 2015 Total of 120 Points. Version 1

Network Basic v0.1. Network Basic v0.1. Chapter 3 Internet Protocol. Chapter 3. Internet Protocol

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Network Layer: outline

Computer Networks Lecture -5- IPv4 Addresses. Dr. Abbas Abdulazeez

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Network Layer: Logical Addressing

Lecture 8 Network Layer: Logical addressing

Communication Systems DHCP

IP Addressing and Subnetting

The Internet Protocol (IP)

Chapter 06 IP Address

Internet Addresses (You should read Chapter 4 in Forouzan)

SEN366 (SEN374) (Introduction to) Computer Networks

Network Layer: Control/data plane, addressing, routers

This talk will cover the basics of IP addressing and subnetting. Topics covered will include:

TCP /IP Fundamentals Mr. Cantu

5.7 K E Y TE R M S 5.8 SUM M A R Y

End-to-End Communication

Introduction Layer 3. IP-Header: and RFC-760 Addressing schemes Subnetting Routing. Layer 3 Solution in Trains

Communication at the network layer is host-to-host Length of address. Total number of addresses used by the protocol. IPv4 & IPv6

LOGICAL ADDRESSING. Faisal Karim Shaikh.

Subnetting and Classless Addressing

Department of Computer Science and Engineering. CSE 3214: Computer Network Protocols and Applications Instructor: N. Vlajic Date: Feb 23, 2016

ECE 461 Internetworking Fall Quiz 1

Objectives. Note: An IP address is a 32-bit address. The IP addresses are unique. The address space of IPv4 is 2 32 or 4,294,967,296.

The Internet Protocol. IP Addresses Address Resolution Protocol: IP datagram format and forwarding: IP fragmentation and reassembly

CSCI Computer Networks Fall 2016

The Internet. 9.1 Introduction. The Internet is a global network that supports a variety of interpersonal and interactive multimedia applications.

TSIN02 - Internetworking

ECE 158A: Lecture 7. Fall 2015

IP Address Assignment

OSI Data Link & Network Layer

CS118 Discussion, Week 6. Taqi

Internet Protocol (IP)

IP - The Internet Protocol

OSI Network Layer. Chapter 5

Lecture 8. Network Layer (cont d) Network Layer 1-1

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1

OSI Data Link & Network Layer

Ref: A. Leon Garcia and I. Widjaja, Communication Networks, 2 nd Ed. McGraw Hill, 2006 Latest update of this lecture was on

OSI Data Link & Network Layer

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1

Internet Fundamentals

Subnetting/Supernetting and Classless Addressing

Networks. an overview. dr. C. P. J. Koymans. Informatics Institute University of Amsterdam. February 4, 2008

Internet Protocols (chapter 18)

Chapter 18. Introduction to Network Layer

Introduction. IP Datagrams. Internet Service Paradigm. Routers and Routing Tables. Datagram Forwarding. Example Internet and Conceptual Routing Table

IP Addresses. IP Addresses

Lab 8 (IP Addressing)

Figure 11 Two-level addressing in classful addressing

CSC 401 Data and Computer Communications Networks

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

Exercise Sheet 4. Exercise 1 (Routers, Layer-3-Switches, Gateways)

Chapter 5. Subnetting/Supernetting and Classless Addressing

CIS 551 / TCOM 401 Computer and Network Security. Spring 2006 Lecture 16

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

CS 3516: Advanced Computer Networks

Introduction to Internetworking

Chapter 18 and 22. IPv4 Address. Data Communications and Networking

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

Networking Basics. EC512 Spring /15/2015 EC512 - Prof. Thomas Skinner 1

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1

The Internet. The Internet is an interconnected collection of netw orks.

7th Slide Set Computer Networks

ET4254 Communications and Networking 1

Chapter 19 Network Layer: Logical Addressing 19.1

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1

IP Addressing. Introductory material. An entire module devoted to IP addresses. Pedro Brandão (PhD) University of Évora

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Chapter 4 Network Layer

ECE 461 Internetworking Fall Quiz 1

Chapter 4 Network Layer: The Data Plane

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

Computer Networking: A Top Down Approach Featuring the. Computer Networks with Internet Technology, William

Department of Computer and IT Engineering University of Kurdistan. Network Layer. By: Dr. Alireza Abdollahpouri

IPv6 : Internet Protocol Version 6

History. IPv6 : Internet Protocol Version 6. IPv4 Year-Wise Allocation (/8s)

MODULE: NETWORKS MODULE CODE: CAN1102C. Duration: 2 Hours 15 Mins. Instructions to Candidates:

Lecture 8. Basic Internetworking (IP) Outline. Basic Internetworking (IP) Basic Internetworking (IP) Service Model

CIS-331 Fall 2014 Exam 1 Name: Total of 109 Points Version 1

TCP/IP and the OSI Model

Position of IP and other network-layer protocols in TCP/IP protocol suite

CS 43: Computer Networks. 21: The Network Layer & IP November 7, 2018

Review for Chapter 4 R1,R2,R3,R7,R10,R11,R16,R17,R19,R22,R24, R26,R30 P1,P2,P4,P7,P10,P11,P12,P14,P15,P16,P17,P22,P24,P29,P30

IPv4. Christian Grothoff.

CS 3516: Computer Networks

Transcription:

Network Layer/IP Protocols 1

Outline IP Datagram (IPv4) NAT Connection less and connection oriented service 2

IPv4 packet header 3

IPv4 Datagram Header Format version of the IP protocol (4 BIts) IP header length (4 Bits) Low Delay, High Throughput, Reliability (8 Bits) length of header + payload (16 Bits) Unique packet id (16 Bits) do not fragment (FLAG) more fragments (FLAG) Specified in terms of no of 8 bytes (13 Bits) 4

IPv4 Datagram Header Format Helps to limit the no. of hops or time spent in the network (8 Bits) Protocol name (TCP, UDP etc.) to whom pass the payload (8 Bits) 16 bit checksum, covers header only Source IP address Optional information, such as source route Destination IP address Due to OPTIONS, the datagram header can be of variable length. So, one can not determine apriori where the data will start. Thus, unpredictable time to process the IP datagram. Hence, OPTIONS dropped in IPv6 5

IP Fragmentation In a case where a router receives a protocol data unit (PDU) larger than the next hop's MTU(Maximum Transmission Unit). MTU: Maximum amount of data that a Link-Layer frame can carry. Each IP datagram is supposed to be encapsulated within the link-layer frame for transportation from one router to other. MTU sets the limit on length of an IP datagram. Also, along the given path: Different routers/links Different link layer protocols Different MTU (A PROBLEM) SOLUTION: It has either of two options if the transport is IPv4: 1. Drop the PDU and send an Internet Control Message Protocol(ICMP) message which indicates the condition Packet too Big. 2. Fragment the IP packet and send it over the link with a smaller MTU. The Identification field, and Fragment offset field along with Don't Fragment & More Fragment flags in the IP protocol header are used for fragmentation and reassembly of IP datagram. 6

IP Fragmentation 1st fragment 1480 bytes in the data field of the IP datagram. identification = 777 offset = 0 (meaning the data should be inserted beginning at byte 0) flag = 1 (meaning there is more) 2nd fragment 1480 byte information field identification = 777 offset = 185 (meaning the data should be inserted beginning at byte 8*185=1,480) flag = 1 (meaning there is more) 3rd fragment 1020 byte (=3980-1480-1480) information field identification = 777 offset = 370 (meaning the data should be inserted beginning at byte 8*370=2,960) flag = 0 (meaning this is the last fragment) REASSEMBLY IS DONE AT THE END SYSTEM, NOT ROUTERS. 7

IP Addressing 8

An IP address is a 32-bit address The IP addresses are unique. The address space of IPv4 is 232 or 4,294,967,296.

Dotted-decimal notation 128.11.3.31 10000000 00001011 00000011 00011111

Hexadecimal Notation 0111 0101 1001 0101 0001 1101 1110 1010 75 95 1D EA Or it can be written as 0x75951DEA

Exercise Change the following IP address from binary notation to dotted-decimal notation. 10000001 00001011 00001011 11101111 Solution 129.11.11.239

Example 2 Change the following IP address from dotted-decimal notation to binary notation. 111.56.45.78 Solution 01101111 00111000 00101101 01001110

Example 3 Find the error, if any, in the following IP address: 111.56.045.78 Solution There are no leading zeroes in dotted-decimal notation (045).

Example 3 (continued) Find the error, if any, in the following IP address: 75.45.301.14 Solution In dotted-decimal notation, each number is less than or equal to 255; 301 is outside this range.

CLASSFUL ADDRESSING

Finding the class in binary notation 2 31 2 30 2 29 2 28 2 28

Example 6 Find the class of the address: 00000001 00001011 00001011 11101111 Solution The first bit is 0. This is a class A address.

Example 6 (Continued) Find the class of the address: 11000001 10000011 00011011 11111111 Solution The first 2 bits are 1; the third bit is 0. This is a class C address.

Finding the class in decimal notation

Example 7 Find the class of the address: 227.12.14.87 Solution The first byte is 227 (between 224 and 239); the class is D.

Example 7 (Continued) Find the class of the address: 193.14.56.22 Solution The first byte is 193 (between 192 and 223); the class is C.

Example 8 In Example 4 we showed that class A has 231 (2,147,483,648) addresses. How can we prove this same fact using dotted-decimal notation? Solution The addresses in class A range from 0.0.0.0 to 127.255.255.255. We notice that we are dealing with base 256 numbers here.

Netid and hostid

Blocks in class A

Millions of class A addresses are wasted.

Blocks in class B

Many class B addresses are wasted.

Blocks in class C

The number of addresses in a class C block is smaller than the needs of most organizations.

Class D addresses are used for multicasting; there is only one block in this class.

Class E addresses are reserved for special purposes; most of the block is wasted.

Private IP address 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

Special IP addresses Loopback IP address 127.0.0.1 (127.0.0.0 to 127.255.255.255) Link-local address 169.254.0.0 /16 Default route 0.0.0.0-0.255.255.255 (0.0.0.0 /8)

Network Address The network address is the first address. The network address defines the network to the rest of the Internet. Given the network address, we can find the class of the address, the block, and the range of the addresses in the block

Example 9 Given the network address 17.0.0.0, find the class, and the range of the addresses. Solution The class is A because the first byte is between 0 and 127. The addresses range from 17.0.0.0 to 17.255.255.255.

Example 10 Given the network address 132.21.0.0, find the class, and the range of the addresses. Solution The class is B netid of 132.21.0.0 Addresses range from 132.21.0.0 to 132.21.255.255

Example 11 Given the network address 220.34.76.0, find the class, and the range of the addresses. Solution The class is C netid of 220.34.76.0 The addresses range from 220.34.76.0 to 220.34.76.255

Mask A mask is a 32-bit binary number that gives the first address in the block (the network address) when bitwise ANDed with an address in the block.

Example 12 Given the address 23.56.7.91 and the default class A mask, find the beginning address (network address). Solution The default mask is 255.0.0.0, which means that only the first byte is preserved and the other 3 bytes are set to 0s. The network address is 23.0.0.0.

Example 13 Given the address 132.6.17.85 and the default class B mask, find the beginning address (network address). Solution The default mask is 255.255.0.0, which means that the first 2 bytes are preserved and the other 2 bytes are set to 0s. The network address is 132.6.0.0.

Example 14 Given the address 201.180.56.5 and the class C default mask, find the beginning address (network address). Solution The default mask is 255.255.255.0, which means that the first 3 bytes are preserved and the last byte is set to 0. The network address is 201.180.56.0.

Sub-netting To reduce wastage of IP addresses in a block, sub-netting is used. Using host bits as network bit of a class-full IP address. 44

Q1. Find the network address 192.168.241.99/27 192.168.241.107/26 192.168.241.117/29 192.168.241.127/27 Sub-netting

Question You are given a class B IP address 172.16.0.0. There is a need of 7 different networks. Find out the first and last IP address of each and subnet mask for each network. 46

Given IP address is of Class B, Default mask is /16 or 255.255.0.0 As required number of subnets are 7, to represent this we require 3 bits (2 3 =8) So number of bits required to borrow from host bits are 3. Total bits for network are now : 16(default for class B)+3 (borrowed from host bits)=19 47

8.8.3.0 (number of net bits in each octet) 11111111.11111111.11100000.00000000 255.255.224.0 (subnet mask) 172.16.0.0 (1 st address), 172.16.0.1 (1 st host) 172.16.00011111.11111110 (last host) 172.16.00011111.11111111 (last address), 48

When we find next address to broadcast that will be: 172.16.00011111.11111111 +1 -------------------------------------------------- 172.16.00100000.00000000 Next subnet s 1 st address is 172.16.32.0 Last address of this subnet is 172.16.63.255 49

Subnet 1 st Address Last Address 1 st host Last host Number of host 1st 172.16.0.0 172.16.31.255 172.16.0.1 172.16.31.254 2 13-2 2 nd 172.16.32.0 172.16.63.255 172.16.32.1 172.16.63.254 2 13-2 3 rd 172.16.64.0 172.16.95.255 172.16.64.1 172.16.95.254 2 13-2 4 th 172.16.96.0 172.16.127.255 172.16.96.1 172.16.127.254 2 13-2 5 th 172.16.128.0 172.16.159.255 172.16.128.1 172.16.159.254 2 13-2 6 th 172.16.160.0 172.16.191.255 172.16.160.1 172.16.191.254 2 13-2 7 th 172.16.192.0 172.16.255.255 172.16.192.1 172.16.255.254 2 13-2 50

Example 1 What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0?

Solution 11001000 00101101 00100010 00111000 11111111 11111111 11110000 00000000 11001000 00101101 00100000 00000000 The subnetwork address is 200.45.32.0.

Example 2 What is the sub-network address if the destination address is 19.30.84.5 and the mask is 255.255.192.0? Solution 19.30.84.5 AND 255.255.192.0 -------------------------------------------------------------------------------------------------------------------------------- Sub-network 19.30.64.0 address

Comparison of a default mask and a subnet mask

The number of subnets must be a power of 2.

Example 3 A company is granted the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets. Solution The number of 1s in the default mask is 24 (class C).

Solution (Continued) The company needs six subnets. This number 6 is not a power of 2. The next number that is a power of 2 is 8 (23). We need 3 more 1s in the subnet mask. The total number of 1s in the subnet mask is 27 (24 + 3). The total number of 0s is 5 (32-27). The subnet mask is

Solution (Continued) 11111111 11111111 11111111 11100000 or 255.255.255.224 The number of subnets is 8. The number of addresses in each subnet is 25 (5 is the number of 0s) or 32.

Example 3

Example 4 A company is granted the site address 181.56.0.0 (class B). The company needs 1000 subnets. Design the subnets. Solution The number of 1s in the default mask is 16 (class B).

Solution (Continued) The company needs 1000 subnets. This number is not a power of 2. The next number that is a power of 2 is 1024 (210). We need 10 more 1s in the subnet mask. The total number of 1s in the subnet mask is 26 (16 + 10). The total number of 0s is 6 (32-26).

Solution (Continued) The mask is 11111111 11111111 11111111 11000000 or 255.255.255.192. The number of subnets is 1024. The number of addresses in each subnet is 26 (6 is the number of 0s) or 64.

Example 4

Variable-length subnetting 64

Exercise 1 For a class C address 192.168.3.0 find out subnet mask for each of the block. 1. Block A: 62 hosts 2. Block B: 30 hosts

Ans 1 1. For the 62 hosts, required bits are 6 (2 6 ) 2. So 6 bits are required for host 3. Remaining bits (32-6=26) are representing network bits 4. 192.168.3.00000000 5. For this block mask /26 Block 1 st IP add 1 st Host IP add Last IP add A 3.0 3.1 3.63 3.62 Last host IP add B 3.64 3.65 3.95 3.94 66

Variable-length subnetting For a class C address 192.168.3.0 find out subnet mask for each of the block.

Example 11 A small organization is given a block with the beginning address and the prefix length 205.16.37.24/29 (in slash notation). What is the range of the block? Solution The beginning address is 205.16.37.24. To find the last address we keep the first 29 bits and change the last 3 bits to 1s. Beginning:11001111 00010000 00100101 00011000 Ending : 11001111 00010000 00100101 00011111 There are only 8 addresses in this block.

Example 12 We can find the range of addresses in Example 11 by another method. We can argue that the length of the suffix is 32-29 or 3. So there are 2 3 = 8 addresses in this block. If the first address is 205.16.37.24, the last address is 205.16.37.31 (24 + 7 = 31).

A block in classes A, B, and C can easily be represented in slash notation as A.B.C.D/ n where n is either 8 (class A), 16 (class B), or 24 (class C).

Example 13 What is the network address if one of the addresses is 167.199.170.82/27? Solution The prefix length is 27, which means that we must keep the first 27 bits as it is and change the remaining bits (5) to 0s. The 5 bits affect only the last byte. The last byte is 01010010. Changing the last 5 bits to 0s, we get 01000000 or 64. The network address is 167.199.170.64/27.

Example 14 An organization is granted the block 130.34.12.64/26. The organization needs to have four subnets. What are the subnet addresses and the range of addresses for each subnet? Solution The suffix length is 6. This means the total number of addresses in the block is 64 (2 6 ). If we create four subnets, each subnet will have 16 addresses.

Solution (Continued) Let us first find the subnet prefix (subnet mask). We need four subnets, which means we need to add two more 1s to the site prefix. The subnet prefix is then /28. Subnet 1: 130.34.12.64/28 to 130.34.12.79/28. Subnet 2 : 130.34.12.80/28 to 130.34.12.95/28. Subnet 3: 130.34.12.96/28 to 130.34.12.111/28. Subnet 4: 130.34.12.112/28 to 130.34.12.127/28. See Figure 5.15 on next slide

Example 14

Example 15 An ISP is granted a block of addresses starting with 190.100.0.0/16. The ISP needs to distribute these addresses to three groups of customers as follows: 1. The first group has 64 customers; each needs 256 addresses. 2. The second group has 128 customers; each needs 128 addresses. 3. The third group has 128 customers; each needs 64 addresses. Design the sub-blocks and give the slash notation for each sub-block. Find out how many addresses are still available after these allocations.

Solution Group 1 For this group, each customer needs 256 addresses. This means the suffix length is 8 (2 8 = 256). The prefix length is then 32-8 = 24. Customer1: 190.100.0.0/24 Customer2: 190.100.1.0/24.. 190.100.0.255/24 190.100.1.255/24 Customer64: 190.100.63.0/24 190.100.63.255/24 Total = 64 256 = 16,384

Solution (Continued) Group 2 For this group, each customer needs 128 addresses. This means the suffix length is 7 (2 7 = 128). The prefix length is then 32-7 = 25. The addresses are: Customer1: 190.100.64.0/25 Customer2: 190.100.64.128/25 190.100.64.127/25 190.100.64.255/25 Customer128: 190.100.127.128/25 190.100.127.255/25 Total = 128 128 = 16,384

Solution (Continued) Group 3 For this group, each customer needs 64 addresses. This means the suffix length is 6 (2 6 = 64). The prefix length is then 32-6 = 26. The addresses are: Cust1: 190.100.128.0/26 Cust2: 190.100.128.64/26 190.100.128.63/26 190.100.128.127/26 Cust128: 190.100.159.192/26 190.100.159.255/26 Total = 128 64 = 8,192