34
Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol, Version 6 (IPv6) 0x8847 MPLS unicast 0x8848 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) Pr e DA SA Ether Type 0800h versio n H L Protoco l 6 TCP Header Data FCS Data Link Header IP Header TCP Header Traile r

Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Embed Size (px)

Citation preview

Page 1: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Protocol Headers

0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol, Version 6 (IPv6) 0x8847 MPLS unicast 0x8848 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)

Pre DA SAEther Type

0800h …version H LProtoc

ol

6 TCP Header

DataFCS

Data Link Header

IP Header TCP Header Trailer

Page 2: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Simple internetwork (example)

R2

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 4(point-to-point)

H7 R3 H8

Network 3 (FDDI)

Page 3: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Service model

R1 R2 R3

H1 H8

ETH FDDI

IP

ETH

TCP

FDDI PPP PPP ETH

IP

ETH

TCP

IP IP IP

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)

Page 4: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IPv4 Header

Page 5: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IPv4 Header

Page 6: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IPv4 Header

Page 7: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IPv4 Header

Page 8: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Protocol Headers

0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol, Version 6 (IPv6) 0x8847 MPLS unicast 0x8848 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)

Pre DA SAEther Type

0800h …version H LProtoc

ol

6 TCP Header

DataFCS

Data Link Header

IP Header TCP Header Trailer

Page 9: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

TCP/IP Protocols

Page 10: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IP Addressing 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

Page 11: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IP Addressing Scheme

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 Dotted-decimal, as in 172.16.30.56 Binary, as in

10101100.00010000.00011110.00111000 Hexadecimal, as in AC.10.1E.38

Page 12: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

00000000.00000000.00000000.00000000 0.0.0.000000000.00000000.00000000.00000001 0.0.0.100000000.00000000.00000000.00000010 0.0.0.200000000.00000000.00000000.00000011 0.0.0.300000000.00000000.00000000.00000100 0.0.0.4……00000000.00000000.00000000.11111111 0.0.0.25500000000.00000000.00000001.00000000 0.0.1.000000000.00000000.00000001.00000001 0.0.1.1…………00000000.11111111.11111111.11111111 0.255.255.25500000001.00000000.00000000.00000000 1.0.0.000000001.00000000.00000000.00000001 1.0.0.1……01111111.00000000.00000000.00000000 127.0.0.0……01111111.11111111.11111111.11111111127.255.255.25510000000.00000000.00000000.00000000 128.0.0.0……10111111.11111111.11111111.11111111191.255.255.25511000000.00000000.00000000.00000000 192.0.0.0…………

Page 13: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Addressing 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

In the sample IP address 172.16.30.56, the 30.56 is the node address

Page 14: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Addressing 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

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

Page 15: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Address Range: Class A

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: 0xxxxxxx

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: 00000000 = 0 01111111 = 127

Page 16: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Address Range: Class B

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: 10000000 = 128 10111111 = 191

As you can see, a Class B network is defined when the first byte is configured from 128 to 191

Page 17: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Address Range: Class C

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: 11000000 = 192 11011111 = 223

Page 18: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Network Address Ranges: Classes D and E

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

Page 19: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

00000000.00000000.00000000.00000000 0.0.0.0……00000000.11111111.11111111.11111111 0.255.255.25501111111.00000000.00000000.00000000127.0.0.0……01111111.11111111.11111111.11111111127.255.255.25510000000.00000000.00000000.00000000128.0.0.0……10111111.11111111.11111111.11111111191.255.255.25511000000.00000000.00000000.00000000192.0.0.0……11011111.11111111.11111111.11111111223.255.255.25511100000.00000000.00000000.00000000224.0.0.0……11101111.11111111.11111111.11111111239.255.255.25511110000.00000000.00000000.00000000240.0.0.0……11111111.11111111.11111111.11111111255.255.255.255

A

B

C

D

E

Loop back

Page 20: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

IP Addressing

Page 21: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Reserved IP Addresses Network address of all 0s Network address of all 1s 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 0s Interpreted to mean “network address” or any host on specified network.

Node address of all 1s Interpreted to mean “all nodes” on the specified network; for example, 128.2.255.255 means “all nodes” on network 128.2 (Class B address).

Entire IP address set to all 1s (same as 255.255.255.255) Broadcast to all nodes on the current network; sometimes called an “all 1s broadcast” or limited broadcast.

Page 22: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Private IP Addresses 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

Page 23: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Private IP Addresses Class A

10.0.0.0 through 10.255.255.255

Class B 172.16.0.0 through 172.31.255.255

Class C 192.168.0.0 through 192.168.255.255

Page 24: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

The Problem Application layer usually deals with URL’s

www.mail.yahoo.com

How a name gets resolved to its corresponding IP ???

IP layer deals with IP addresses

IP addresses (in IP Packet) are part of the data of an Ethernet frame

Ethernet only recognizes physical addresses

Page 25: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

The Problem 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

Page 26: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Address Resolution Protocol (ARP)

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??

Page 27: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

ARP

Network software in the receiver further examines the ARP message to distinguish between ARP requests and replies

6 Octets 2 Octets6 Octets 46 - 1500 Octets 4 Octets

D.Address S.AddressFrameType Frame Data CRC

0806 ARP req/reply (28 Octet) Pad (18)

Page 28: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Working of ARP 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”

Page 29: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Working of ARP

Hardware Type Protocol Type (080616)

HLEN PLEN (Operation) 1

0:0:0C: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.50.1.10 Target IP (octet 0-3)

0 8 16 24 32

Page 30: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

Working of ARP

Hardware Type Protocol Type (080616)

HLEN PLEN (Operation) 2

0:0:0C: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)

0C:75:25:12 Target HA (octet 2-5)

150.50.1.94 Target IP (octet 0-3)

0 8 16 24 32

Page 31: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

ARP Cache The ARP requests are broadcasted

Broadcasting is far more expensive if every time a machine needs to transmit a packet to another

Computers maintains a cache of recently acquired IP-to-Physical address mapping

Thus before sending an ARP request, a machine always looks its ARP cache to find the desired mapping

ARP requests only broadcasted if no mapping found in the cache

Page 32: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

RARP RARP is Reverse Address Resolution Protocol

Used to map hardware addresses to IP addresses (normally at booting time)

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.x.x.x.x, does anyone out there knows my IP ?”

Page 33: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

RARP

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

Page 34: Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,

RARP Frame

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)

0 8 16 24 32