Docsity

Network Layer in Computer Networks: Addressing, Routing, and Service Models, Lecture notes of Data Communication Systems and Computer Networks

Partial preview of the text

Download Network Layer in Computer Networks: Addressing, Routing, and Service Models and more Lecture notes Data Communication Systems and Computer Networks in PDF only on Docsity!

Chapter 6 – NETWORK LAYER AND

ROUTING

6.1 - Introduction

• Responsible for source-to-destination delivery of

packets

• Network Layer has 4 basic functions:

– Addressing

– Encapsulation

– Routing

– Decapsulation

• Main functions of routers (network layer devices)

– Path determination

– Forwarding

– Call setup (for some architectures like ATM)

6.3 – Network Service Models

  • The network service model defines the characteristics of

end-to-end transport of data between end systems.

  • (^) Services provided by network layer to transport layer

include:

  • (^) Guaranteed delivery
  • (^) Guaranteed delivery with bounded delay
  • (^) In-order datagram delivery
  • Guaranteed minimum bandwidth
  • (^) Guaranteed maximum jitter
  • (^) There exist two network service models:
  • (^) Virtual Circuit (E.g. Frame relay, ATM, X.25)
  • (^) Call setup/teardown, VC number, router maintains state of each connection, allocation of resources (bandwidth, buffer)
  • (^) Datagram (E.g. Internet)
  • (^) Destination address, best effort, no state

6.4 – Internet Protocol (IP)

  • (^) Two versions of IP (IPv4 – defined in RFC 791 and IPv6 defined in RFC 2373 and 2460)
  • (^) IPv4 has the following headers:

Internet Protocol (cont’d)

  • (^) Large IP datagram is divided (“fragmented”) within

network as it passes from a link of higher MTU

(Maximum Transfer Unit) to a link of lower MTU, to be

assembled only at the final destination. IP header bits

are used to identify and order related fragments.

  • (^) Suppose, datagram of 4,000 bytes (20 bytes of IP

header and 3,980 bytes of IP payload) arrives at a router

and is to be forwarded to a link with MTU of 1,500 bytes

(1480 bytes of payload). The datagram needs to be

defragmented into 3: 1st and 2nd fragments of payload

size 1,480 bytes each and the 3rd of 1020 bytes (3980-

(2*1480)). MF flag will be set to 1 in the first two

(fragmented) datagrams and 0 in the 3rd. Offset value is

given in terms of 8-byte chunks; thus the offset value for

the 1st datagram is 0, for the 2nd datagram is 185

(=1480/8) and that for the 3rd is 370 (=2*185).

6.4 – IP Addressing

  • (^) IPv4 address is a 32-bit address that identifies a host or router interface.
  • (^) It has two parts: network (high order bits) and host (low order bits) Network Host 32 bits
  • (^) Network numbers are managed by a non-profit corporation called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts.
  • (^) ICANN has delegated parts of the address space to various regional authorities (RIRs – Regional Internet Registers), which then dole out IP addresses to ISPs and other companies. The RIRs are:
  • (^) AfriNIC (African Network Information Centre) - Africa Region
  • (^) APNIC (Asia Pacific Network Information Centre) - Asia/Pacific Region
  • (^) ARIN (American Registry for Internet Numbers) - North America Region
  • (^) LACNIC (Regional Latin-American and Caribbean IP Address Registry) - Latin America and some Caribbean Islands
  • (^) RIPE NCC (Reseaux IP Europeans) - Europe, the Middle East, and Central Asia

Classful IP Addressing

  • (^) Depending on the values of the network and host

portions, we have three types of addresses:

  • (^) Network address – its host portion bits are all 0.
  • (^) Broadcast address - its host portion bits are all 1.
  • (^) Host addresses - its host portion cannot all be 0 or 1.
  • (^) The values 0 and 1 (all 0’s and all 1’s) have special

meanings:

  • (^) The IP address 0.0.0.0 is used by hosts when they are being booted. It means this host.
  • (^) IP addresses with 0 as network number refer to the current network. These addresses allow machines to refer to their own network without knowing its number (but they have to know its class to know how many 0’s to include).
  • (^) The address consisting of all 1’s allows broadcasting on the local network, typically a LAN.
  • (^) All addresses of the form 127.xx.yy.zz are reserved for

loopback testing.

Subnet-Mask

  • (^) A subnet mask is used to delineate the network portion from the host portion.
  • (^) It is 32 bits long with all its network portion bits set to 1 and all its host portion bits set to 0.
  • (^) It can be represented in dotted binary, dotted decimal or slash (prefix length) notation.
  • (^) The subnet-mask of class B network, can be represented as follows: Dotted binary: 11111111.11111111.00000000. Dotted decimal: 255.255.0. Slash (prefix length): /
  • (^) The bit-wise ANDing of the IP address and the subnet mask gives the network address
  • (^) The “default” subnet masks for classful IP addresses fall on “natural octet boundaries”, like /8, /16, or /24.
  • (^) For classless IP addressing, the subnet masks do not have to end on “natural octet boundaries”, like /12, /20 or /27.

Subnneting

Example:

Given an IP address of 150.100.14.163 and a

subnet mask of 255.255.255.128, determine the

maximum number of hosts per subnet.

Solution:

The subnet mask of the classful network (Class

B) was /16 and that for the subnetwork is /25.

Thus, 9 bits are borrowed for subnetting and 7

bits are left for the host portion. The number of

hosts is thus 2^7 -2 = 62 (2 is subtracted from the

theoretical number of possible bit combinations

in the host portion to account for the subnetwork

address (all 0’s) and broadcast address (all 1’s)).

  • (^) Special Unicast IPv4 Addresses
    • (^) Loopback Address (127.0.0.0 to 127.255.255.255) is a special address that hosts use to direct traffic to themselves.
    • (^) Link-Local Addresses (169.254.0.0 to 169.254.255. (169.254.0.0 /16)) is automatically assigned to the local host by the operating system in environments where no IP configuration is available.
    • (^) TEST-NET Addresses (192.0.2.0 to 192.0.2.255 (192.0.2.0 /24)) is set aside for teaching and learning purposes; these can be used in documentation and network examples.
  • (^) Private IP Addresses
    • (^) RFC 1918 has defined three blocks of IP addresses for private use. These addresses will not be routed in the Internet. They are used within a private network. Thus, the same range of these addresses can be used by several organizations. These are: - (^) 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8) - (^) 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12) - (^) 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16) - (^) Need NAT/PAT (next)

Assigning IP address to Hosts

  • (^) IP addresses are assigned to hosts either

manually or dynamically (DHCP).

  • (^) DHCPDISCOVER message issued to local subnet on

UDP port 67 with destination address 255.255.255.255.

(If DHCP server on separate subnet, DHCP relay

agent)

  • (^) DHCPOFFER message sent back to client on UDP port

68. (If on different segments, DHCP message is sent to

DHCP relay agent on UDP port 67 and then to clent on

UDP port 68).

  • (^) DHCPREQUEST (broadcast) message sent to DHCP

server accepting parameters in DHCPOFFER.

  • (^) DHCPACK message sent to client; it contains all the

configurations

Network Address Translation (NAT)

  • (^) NAT router must:
    • (^) replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #), for outgoing packets. And remote clients/servers will respond using (NAT IP address, new port #) as destination address.
    • (^) remember (using NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair
    • (^) replace (NAT IP address, new port #) in destination fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table, for incoming datagrams.

IP Version 6

  • (^) 128-bit address , making 340 trillion trillion trillion IP addresses available
  • (^) IpV6 format is as shown below:
  • (^) IPv6 addresses are represented by breaking them up into eight 16-bit segments. Each segment is written in hexadecimal between 0x and 0xFFFF, separated by colons.
  • (^) An example of a written IPv6 address is: 3ffe:1944:0100:000a:0000:00bc:2500:0d0b

IP Version 6 (Cont’d)

  • (^) IPv6 address has the following format:
  • (^) The host portion of the address is called the Interface ID as a host can have more than one IPv6 interface.
  • (^) Subnet Identifier is part of the network portion of the address
  • (^) With very few exceptions:
  • (^) Interface ID is 64 bits
  • (^) Subnet ID field is 16 bits, and provides for 65,536 separate subnets
  • (^) The IANA and the Regional Internet Registries (RIRs) assign IPv prefixes—normally /32 or /35 in length—to the Local Internet Registries (LIRs).
  • (^) The LIRs then allocate longer prefixes to their customers. In the majority of cases, the prefixes assigned by the LIRs are /