Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

REDES DE COMPUTADORES

Tema 5. Capa de Red


Alberto Arellano A. Ing. Msc.
aarellano@espoch.edu.ec
CCNA – CCNP - CCSP
1
Encapsulation

DATA

SEGMENT DATA
S.P / D.P. / S.N. / Ack # / …

DATA (SEGMENT)
PACKET
IPv / HLEN / Flag / S. IP / D. IP / …

Frame Header FRAME


DATA (PACKET) Trailer

111010110101011100001001011010101010010101010101101101010001010101010110101010
IP

Functions
of the
Network
Layer Layer IP

The network layer, or OSI Layer 3, provides services to allow end devices to
exchange data across the network.
The network layer uses four basic processes:
Addressing end devices
Encapsulation
Routing
De-encapsulation
Network Layer Protocols

Common Network Layer Protocols


Internet Protocol version 4 (IPv4)
Internet Protocol version 6 (IPv6)
Legacy Network Layer Protocols
Novell Internetwork Packet Exchange (IPX)
AppleTalk
Connectionless Network Service (CLNS/DECNet)
Characteristics of IPv4
Connectionless:
No connection is established before sending data
packets.
Best effort delivery:
No additional overhead is used to guarantee
packet delivery.
Media independent:
Operates independently of the medium carrying
the data.
Best Effort Delivery =
Unreliable
IPv4 Media Independent

IP doesn’t care what type of media the packet is carried on.


The
The outgoing
outgoing link
large enough
link has
MTU
has aa
but to
I
MTU
It is my job to reconstruct
the packets.
smaller MTU so I have
don’t reconstruct
fragment packets.
the packets.
IP Packet

IP Packet IP Packet
IP Packet
IP Packet

Network link with Network link with Network link with


larger MTU smaller MTU larger MTU

IP Packet IP Packet

IP Packet IP Packet

IP Packet IP Packet
The Network layer does consider the maximum size of PDU that each medium can
transport.
This is referred to as the Maximum Transmission Unit (MTU).
The Network layer determines how large to create the packets.
Routers may need to split up a packet when forwarding it from one media to a
media with a smaller MTU.
This process is called fragmenting the packet or fragmentation.
This is similar to segmenting at the Transport layer but happens at the Network layer.
IPv4 Packet

IP Header Data (Payload)

IPv4 has been in use since 1983 when it


was deployed on the Advanced Research
Projects Agency Network (ARPANET).
An IPv4 packet has two parts:
IP Header - Identifies the packet
characteristics.
Payload - Contains the Layer 4 segment
information and the actual data.
IPv4 Header – Significant
Fields
Byte 1 Byte 2 Byte 3 Byte 4

IP Header Differentiated Services


Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional)
Padding
IPv4 Header – Validation
Fields
Byte 1 Byte 2 Byte 3 Byte 4

IP Header Differentiated Services


Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


Sample IPv4 Packet
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Version (4 bits)
– Indicates the version of IP currently used.
– 0100 = 4 and therefore IPv4
– 0110 = 6 and therefore IPv6
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

IP Header Length (4 bits)


– Identifies the number of 32-bit words in the header.
– The IHL value varies due to the Options and Padding fields.
– The minimum value for this field is 5 (i.e., 5×32 = 160 bits =
20 bytes) and the maximum value is 15 (i.e., 15×32 = 480
bits = 60 bytes).
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Differentiated Services (8 bits)


– Formerly called the Type of Service (ToS) field.
– The field is used to determine the priority of each packet.
– First 6 bits identify the Differentiated Services Code Point (DSCP) value for QoS.
– Last 2 bits identify the explicit congestion notification (ECN) value used to prevent
dropped packets during times of network congestion.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Total Length (16 bits)


– Sometimes referred to as the Packet Length.
– Defines the entire packet (fragment) size, including header and data, in bytes.
– The minimum length packet is 20 bytes (20-byte header + 0 bytes data) and the
maximum is 65,535 bytes. .
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional)
A router may have to fragment
Padding
a packet
when forwarding it from one medium to
another medium that has a smaller MTU.
When this happens, fragmentation
occurs and the IPv4 packet uses the
following 3 fields to keep track of the
fragments
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Identification (16 bits)


– Field uniquely identifies the fragment of an
original IP packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Flag (3 bits)
– This 3-bit field identifies how the packet is fragmented.
– It is used with the Fragment Offset and Identification
fields to help reconstruct the fragment into the original
packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Fragment Offset (13 bits)


– Field identifies the order in which to place the packet
fragment in the reconstruction of the original
unfragmented packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


Time-to-Live (TTL) (8 bits)
– Used to limit the lifetime of a packet.
– It is specified in seconds but is commonly referred to as hop
count.
– The packet sender sets the initial TTL value and is decreased
by one each time the packet is processed by a router, or hop.
– If the TTL field decrements to zero, the router discards the
packet and sends an ICMP Time Exceeded message to the
source IP address.
– The traceroute command uses this field to identify the routers
used between the source and destination.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Protocol (8 bits)
– Field indicates the data payload type that the packet is
carrying, which enables the network layer to pass the data
to the appropriate upper-layer protocol.
– Common values include ICMP (1), TCP (6), and UDP (17).
– Others: GRE (47), ESP (50), EIGRP (88), OSPF (89)
– http://www.iana.org/assignments/protocol-numbers/
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Header Checksum (8 bits)


– Field is used for error checking of the IP header.
– The checksum of the header is recalculated and
compared to the value in the checksum field.
– If the values do not match, the packet is discarded.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Source IP Address (32 bits)


– Contains a 32-bit binary value that represents the
source IP address of the packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Destination IP Address (32 bits)


– Contains a 32-bit binary value that represents the
destination IP address of the packet.

You might also like