The Network Layer

Provides services to allow end devices to exchange data

IP version 4 (IPv4) and IP version 6 (IPv6) are the principle network layer communication protocols.

The network layer performs four basic operations:

  • Addressing end devices
  • Encapsulation
  • Routing
  • De-encapsulation
IP Encapsulation

IP encapsulates the transport layer segment.

IP can use either an IPv4 or IPv6 packet and not impact the layer 4 segment.

IP packet will be examined by all layer 3 devices as it traverses the network.

The IP addressing does not change from source to destination.

Connectionless

IP does not establish a connection with the destination before sending the packet.

There is no control information needed (synchronizations, acknowledgments, etc.).

The destination will receive the packet when it arrives, but no pre-notifications are sent by IP.

If there is a need for connection-oriented traffic, then another protocol will handle this (typically TCP at the transport layer).

Best Effort

IP is Best Effort IP will not guarantee delivery of the packet.
IP has reduced overhead since there is no mechanism to resend data that is not received.
IP does not expect acknowledgments.
IP does not know if the other device is operational or if it received the packet.

Media Independent

IP is unreliable: 
It cannot manage or fix undelivered or corrupt packets.
IP cannot retransmit after an error.
IP cannot realign out of sequence packets.
IP must rely on other protocols for these functions.
IP is media Independent:
IP does not concern itself with the type of frame required at the data link layer or the media type at the physical layer.
IP does not concern itself with the media type IP can be sent over any media type: copper, fiber, or wireless.

IPv4 Packet Header
IPv6 Packet Header
Host Forwarding Decision

Packets are always created at the source.
Each host devices creates their own routing table.
A host can send packets to the following:
-Itself – 127.0.0.1 (IPv4), ::1 (IPv6)
-Local Hosts – destination is on the same LAN
-Remote Hosts – devices are not on the same LAN

Host Forwarding Decision

The Source device determines whether the destination is local or remote
Method of determination:
IPv4 – Source uses its own IP address and Subnet mask, along with the destination IP address
IPv6 – Source uses the network address and prefix advertised by the local router
Local traffic is dumped out the host interface to be handled by an intermediary device.
Remote traffic is forwarded directly to the default gateway on the LAN

Default Gateway

A router or layer 3 switch can be a default-gateway.

Features of a default gateway (DGW):

  • It must have an IP address in the same range as the rest of the LAN.
  • It can accept data from the LAN and is capable of forwarding traffic off of the LAN.
  • It can route to other networks.

If a device has no default gateway or a bad default gateway, its traffic will not be able to leave the LAN.

Router Packet Forwarding Decision

IP Router Routing Table

There three types of routes in a router’s routing table:

  • Directly Connected – These routes are automatically added by the router, provided the interface is active and has addressing.
  • Remote – These are the routes the router does not have a direct connection and may be learned:
  • Manually – with a static route
  • Dynamically – by using a routing protocol to have the routers share their information with each other
  • Default Route – this forwards all traffic to a specific direction when there is not a match in the routing table

IP Router Routing Table

The show ip route command shows the following route sources:

  • L – Directly connected local interface IP address
  • C – Directly connected network
  • S – Static route was manually configured by an administrator
  • O – OSPF
  • D – EIGRP

This command shows types of routes:

  • Directly Connected – C and L
  • Remote Routes – O, D, etc.
  • Default Routes – S*

Static Routing

Static Route Characteristics:

  • Must be configured manually
  • Must be adjusted manually by the administrator when there is a change in the topology
  • Good for small non-redundant networks
  • Often used in conjunction with a dynamic routing protocol for configuring a default route

Dynamic Routing

Dynamic Routes Automatically:

  • Discover remote networks
  • Maintain up-to-date information
  • Choose the best path to the destination
  • Find new best paths when there is a topology change

Dynamic routing can also share static default routes with the other routers.

R1 Configuration

hostname R1
!
interface GigabitEthernet0/0
ip address 192.168.10.1 255.255.255.0
ip nat inside
no shutdown
!
interface GigabitEthernet0/1
ip address 172.16.1.1 255.255.255.0
ip nat inside
no shutdown
!
interface GigabitEthernet0/2
ip address 172.16.2.1 255.255.255.0
ip nat inside
no shutdown
!
interface Serial0/0/0
ip address 209.165.200.1 255.255.255.0
ip nat outside
no shutdown
!
ip nat inside source list 1 interface Serial0/0/0 overload
!
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
access-list 1 permit 192.168.30.0 0.0.0.255
!
ip route 192.168.20.0 255.255.255.0 172.16.1.2
ip route 192.168.30.0 255.255.255.0 172.16.2.3
ip route 0.0.0.0 0.0.0.0 s0/0/0

R2 Configuration

hostname R2
!
interface GigabitEthernet0/0
ip address 192.168.20.1 255.255.255.0
no shutdown
!
interface GigabitEthernet0/1
ip address 172.16.1.2 255.255.255.0
no shutdown
!
ip route 192.168.10.0 255.255.255.0 172.16.1.1
ip route 192.168.30.0 255.255.255.0 172.16.1.1
ip route 172.16.2.0 255.255.255.0 172.16.1.1
ip route 0.0.0.0 0.0.0.0 172.16.1.1

R3 Configuration

hostname R3
!
interface GigabitEthernet0/0
ip address 192.168.30.1 255.255.255.0
no shutdown
!
interface GigabitEthernet0/2
ip address 172.16.2.3 255.255.255.0
no shutdown
!
ip route 192.168.10.0 255.255.255.0 172.16.2.1
ip route 192.168.20.0 255.255.255.0 172.16.2.1
ip route 172.16.1.0 255.255.255.0 172.16.2.1
ip route 0.0.0.0 0.0.0.0 172.16.2.1

 

33
Created on

Network Layer Quiz

Test Your Understanding

1 / 7

Which statement accurately describes a characteristic of IPv4?

2 / 7

Which command can be used on a Windows host to display the routing table?

3 / 7

A router receives a packet from the Gigabit 0/0 interface and determines that the packet needs to be forwarded out the Gigabit 0/1 interface. What will the router do next?

4 / 7

What information is added during encapsulation at OSI Layer 3?

5 / 7

When a router receives a packet, what information must be examined in order for the packet to be forwarded to a remote destination?

6 / 7

A computer has to send a packet to a destination host in the same LAN. How will the packet be sent?

7 / 7

Which field in an IPv4 packet header will typically stay the same during its transmission?

Your score is

0%