Protocol Headers Data Link Header IP Header Pre

  • Slides: 34
Download presentation
Protocol Headers Data Link Header IP Header Pre DA SA 0800 h version H

Protocol Headers Data Link Header IP Header Pre DA SA 0800 h version H L … Ether Type TCP Header Trailer 6 … TCP Header Data FCS Protocol 0 x 0800 Internet Protocol, Version 4 (IPv 4) 0 x 0806 Address Resolution Protocol (ARP) 0 x 8100 IEEE 802. 1 Q-tagged frame 0 x 86 DD Internet Protocol, Version 6 (IPv 6) 0 x 8847 MPLS unicast 0 x 8848 MPLS multicast 1: Internet Control Message Protocol (ICMP) 2: Internet Group Management Protocol (IGMP) 6: Transmission Control Protocol (TCP) 17: User Datagram Protocol (UDP) 89: Open Shortest Path First (OSPF)

Simple internetwork (example)

Simple internetwork (example)

Service model Host-to-host service Philosophy: Define a model that is so undemanding that almost

Service model Host-to-host service Philosophy: Define a model that is so undemanding that almost any network technology is able to provide the required service. (IP)

IPv 4 Header

IPv 4 Header

IPv 4 Header

IPv 4 Header

IPv 4 Header

IPv 4 Header

IPv 4 Header

IPv 4 Header

Protocol Headers Data Link Header IP Header Pre DA SA 0800 h version H

Protocol Headers Data Link Header IP Header Pre DA SA 0800 h version H L … Ether Type TCP Header Trailer 6 … TCP Header Data FCS Protocol 0 x 0800 Internet Protocol, Version 4 (IPv 4) 0 x 0806 Address Resolution Protocol (ARP) 0 x 8100 IEEE 802. 1 Q-tagged frame 0 x 86 DD Internet Protocol, Version 6 (IPv 6) 0 x 8847 MPLS unicast 0 x 8848 MPLS multicast 1: Internet Control Message Protocol (ICMP) 2: Internet Group Management Protocol (IGMP) 6: Transmission Control Protocol (TCP) 17: User Datagram Protocol (UDP) 89: Open Shortest Path First (OSPF)

TCP/IP Protocols

TCP/IP Protocols

IP Addressing n n An IP address is a numeric identifier assigned to each

IP Addressing n n An IP address is a numeric identifier assigned to each machine on an IP network It designates the specific location of a device on the network An IP address is a software address, not a hardware address Hardware address is hard-coded on a Network Interface Card (NIC) and used for finding hosts on a local network

IP Addressing Scheme n n n An IP address consists of 32 bits of

IP Addressing Scheme n n n An IP address consists of 32 bits of information These bits are divided into four sections, referred to as octets or bytes Three methods of depiction n Dotted-decimal, as in 172. 16. 30. 56 Binary, as in 10101100. 00010000. 00011110. 00111000 Hexadecimal, as in AC. 10. 1 E. 38

00000000. 000000000001 00000000. 00000010 00000000. 00000011 00000000. 00000100 …… 00000000. 1111 000000001. 00000000. 00000001

00000000. 000000000001 00000000. 00000010 00000000. 00000011 00000000. 00000100 …… 00000000. 1111 000000001. 00000000. 00000001 …… …… 0000. 11111111 00000001. 000000001 …… 01111111. 00000000 …… 011111111. 1111 100000000. 0000 …… 1011111111. 1111 1100000000. 0000 …… …… 0. 0. 1 0. 0. 0. 2 0. 0. 0. 3 0. 0. 0. 4 0. 0. 0. 255 0. 0. 1. 0 0. 0. 1. 1 0. 255 1. 0. 0. 0 1. 0. 0. 1 127. 0. 0. 0 127. 255 128. 0. 0. 0 191. 255 192. 0. 0. 0

Network Addressing n n n The network address (which can also be called the

Network Addressing n n n The network address (which can also be called the network number) uniquely identifies each network Every machine on the same network shares that network address as part of its IP address In the IP address 172. 16. 30. 56, for example, 172. 16 is the network address The node address uniquely identifies, each machine on a network This part of the address must be unique because it identifies a particular machine, also referred as a host address n In the sample IP address 172. 16. 30. 56, the 30. 56 is the node address

Network Addressing n n The designers of the Internet decided to create classes of

Network Addressing n n The designers of the Internet decided to create classes of networks based on network size For the small number of networks possessing a very large number of nodes, they created the rank Class A network n n At the other extreme is the Class C network, which is reserved for the numerous networks with a small number of nodes The class distinction for networks between very large and very small is predictably called the Class B network

Network Address Range: Class A n n n First bit of the first byte

Network Address Range: Class A n n n First bit of the first byte in a Class A network address must always be off, or 0 This means a Class A address must be between 0 and 127 Consider the following network address: n n 0 xxxxxxx If we turn the other 7 bits all off and then turn them all on, we’ll find the Class A range of network addresses: n n 0000 = 0 01111111 = 127

Network Address Range: Class B n n First bit of the first byte must

Network Address Range: Class B n n First bit of the first byte must always be turned on, but the second bit must always be turned off If you turn the other 6 bits all off and then all on, you will find the range for a Class B network: n n n 10000000 = 128 10111111 = 191 As you can see, a Class B network is defined when the first byte is configured from 128 to 191

Network Address Range: Class C n n n For Class C networks, first 2

Network Address Range: Class C n n n For Class C networks, first 2 bits of the first octet are always turned on, but the third bit can never be on Following the same process as the previous classes, convert from binary to decimal to find the range Range for a Class C network: n n 11000000 = 192 11011111 = 223

Network Address Ranges: Classes D and E n n n The addresses between 224

Network Address Ranges: Classes D and E n n n The addresses between 224 and 255 are reserved for Class D and E networks Class D (224– 239) is used for multicast addresses Class E (240– 255) for scientific purposes

A Loop back B C D E 00000000. 0000 0. 0 …… 0000. 11111111

A Loop back B C D E 00000000. 0000 0. 0 …… 0000. 11111111 0. 255 01111111. 00000000 …… 011111111. 1111 100000000. 0000 …… 1011111111. 1111 1100000000. 0000 …… 11011111111. 1111 11100000000. 0000 …… 11101111111100000000 …… 11111111. 1111 127. 0. 0. 0 127. 255 128. 0. 0. 0 191. 255 192. 0. 0. 0 223. 255 224. 0. 0. 0 239. 255 240. 0 255

IP Addressing

IP Addressing

Reserved IP Addresses n n n Network address of all 0 s Network address

Reserved IP Addresses n n n Network address of all 0 s Network address of all 1 s Network 127. 0. 0. 1 Reserved for loopback tests. Designates the local node and allows that node to send a test packet to itself without generating network traffic. Node address of all 0 s Interpreted to mean “network address” or any host on specified network. Node address of all 1 s Interpreted to mean “all nodes” on the specified network; for example, 128. 2. 255 means “all nodes” on network 128. 2 (Class B address). Entire IP address set to all 1 s (same as 255) Broadcast to all nodes on the current network; sometimes called an “all 1 s broadcast” or limited broadcast.

Private IP Addresses n n These addresses can be used on a private network,

Private IP Addresses n n These addresses can be used on a private network, but they’re not routable through the Internet A measure of well-needed security Also conveniently saves valuable IP address space Network Address Translation (NAT), which basically takes a private IP address and converts it for use on the Internet

Private IP Addresses n n n Class A 10. 0 through 10. 255 Class

Private IP Addresses n n n Class A 10. 0 through 10. 255 Class B 172. 16. 0. 0 through 172. 31. 255 Class C 192. 168. 0. 0 through 192. 168. 255

The Problem n Application layer usually deals with URL’s n www. mail. yahoo. com

The Problem n Application layer usually deals with URL’s n www. mail. yahoo. com n How a name gets resolved to its corresponding IP ? ? ? n IP layer deals with IP addresses n IP addresses (in IP Packet) are part of the data of an Ethernet frame n Ethernet only recognizes physical addresses

The Problem n n Two machines on a given network can communicate only if

The Problem n n Two machines on a given network can communicate only if they know each others physical addresses How a host or a router maps an IP address to a correct physical address when it needs to send a packet across a physical network ? ? ? This mapping is required at each step along a path from the original source to its ultimate destination The problem of mapping high level IP addresses to the physical addresses is know as the address resolution problem

Address Resolution Protocol (ARP) n n n ARP is the Address Resolution Protocol (RFC

Address Resolution Protocol (ARP) n n n ARP is the Address Resolution Protocol (RFC 826) It dynamically maps the IP address to physical address ARP allows a host to find the physical address of a target host on the same physical network given only the targets IP address For networks like ethernet that have broadcast capability It does not need a centralized database Where does the ARP lies in the TCP/IP protocol stack? ?

ARP D. Address S. Address Frame Type Frame Data CRC 6 Octets 2 Octets

ARP D. Address S. Address Frame Type Frame Data CRC 6 Octets 2 Octets 46 - 1500 Octets 4 Octets 0806 n ARP req/reply (28 Octet) Pad (18) Network software in the receiver further examines the ARP message to distinguish between ARP requests and replies

Working of ARP n n IP layer datagram is sent to a host or

Working of ARP n n IP layer datagram is sent to a host or a router on a locally attached network The sender knows the IP address of destination ARP sends an ethernet frame called an ARP request to every host on the network (broadcast) The ARP request message means, “if you are the owner of this IP address, please respond to me with your hardware address”

Working of ARP 8 0 16 Hardware Type HLEN PLEN 24 Protocol Type (080616)

Working of ARP 8 0 16 Hardware Type HLEN PLEN 24 Protocol Type (080616) (Operation) 1 0: 0: 0 C: 75 Sender HA (octet 0 -3) 25: 12 (Sender HA, octet 4 -5) 150. 50 Sender IP (octet 0 -1) 1. 94 (Sender IP, octet 2 -3) Target HA (octet 0 -1) Target HA (octet 2 -5) 150. 1. 10 Target IP (octet 0 -3) 32

Working of ARP 8 0 16 Hardware Type HLEN PLEN 24 Protocol Type (080616)

Working of ARP 8 0 16 Hardware Type HLEN PLEN 24 Protocol Type (080616) (Operation) 2 0: 0: 0 C: 75 Sender HA (octet 0 -3) 80: 37 (Sender HA, octet 4 -5) 150. 50 Sender IP (octet 0 -1) 1. 10 (Sender IP, octet 2 -3) 0: 0 Target HA (octet 0 -1) 0 C: 75: 25: 12 Target HA (octet 2 -5) 150. 1. 94 Target IP (octet 0 -3) 32

ARP Cache n The ARP requests are broadcasted n Broadcasting is far more expensive

ARP Cache n The ARP requests are broadcasted n Broadcasting is far more expensive if every time a machine needs to transmit a packet to another n Computers maintains a cache of recently acquired IP-to. Physical address mapping n Thus before sending an ARP request, a machine always looks its ARP cache to find the desired mapping n ARP requests only broadcasted if no mapping found in the cache

RARP n RARP is Reverse Address Resolution Protocol n Used to map hardware addresses

RARP n RARP is Reverse Address Resolution Protocol n Used to map hardware addresses to IP addresses (normally at booting time) n n In case of diskless booting, the systems reads its hardware address from the interface card and send as RARP request asking for someone to reply with the diskless system’s IP address (in an RARP reply) It says: “My 48 -bit MAC address is x. x, does anyone out there knows my IP ? ”

RARP n n n The RARP server sees the request, looks up and map

RARP n n n The RARP server sees the request, looks up and map the ethernet address and sends back corresponding IP address As with ARP, the RARP requests is broadcasted and RARP reply is unicasted The frame structure of ARP and RARP is same

RARP Frame 0 8 16 24 32 Hardware Type Protocol Type (083516) HLEN PLEN

RARP Frame 0 8 16 24 32 Hardware Type Protocol Type (083516) HLEN PLEN Operation (3 or 4) Sender HA (octet 0 -3) Sender HA (octet 4 -5) Sender IP (octet 0 -1) Sender IP (octet 2 -3) Target HA (octet 0 -1) Target HA (octet 2 -5) Target IP (octet 0 -3)