56
1 Kyung Hee University Part 4 : Part 4 : Network Layer Network Layer

1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

Embed Size (px)

Citation preview

Page 1: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

11

Kyung Hee University

Part 4 :Part 4 :Network LayerNetwork Layer

Page 2: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

22

Kyung Hee University

Role and Position of Network LayerRole and Position of Network Layer

Network layer in the Internet model is responsible for

carrying a packet from one computer to another

It is responsible for host-to-host delivery.

Position of network layer

Page 3: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

33

Kyung Hee University

Duties of Network LayerDuties of Network Layer

Page 4: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

44

Kyung Hee University

Chapter 19Chapter 19

Host-to-host DelivHost-to-host Delivery :ery :

Interworking, AddrInterworking, Addressing, essing,

and Routingand Routing

Page 5: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

55

Kyung Hee University

19.1 Internetworks19.1 Internetworks

The physical and data link layers of a network operate

locally

Page 6: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

66

Kyung Hee University

Links in an InternetworkLinks in an Internetwork

Page 7: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

77

Kyung Hee University

Network Layer in an InternetworkNetwork Layer in an Internetwork

Page 8: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

88

Kyung Hee University

Network Layer at the SourceNetwork Layer at the Source

Page 9: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

99

Kyung Hee University

Network Layer at a RouterNetwork Layer at a Router

Page 10: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1010

Kyung Hee University

Network Layer at the DestinationNetwork Layer at the Destination

Page 11: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1111

Kyung Hee University

SwitchingSwitching

Virtual circuit approach – relationship between all packets

belonging to a message is preserved – a single route is

chosen, and all packets take that route

Datagram approach – each packet is treated independently

of all others – thus, packets in the same message can take

different routes, and possibly arrive out of order

Page 12: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1212

Kyung Hee University

Datagram ApproachDatagram Approach

Page 13: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1313

Kyung Hee University

Internet as a Connectionless NetworkInternet as a Connectionless Network

In a connection-oriented service, the source first

makes connection with the destination before sending

a packet.

They are sent on the same path in sequential order.

In a connectionless service, the network layer protocol

treats each packet independently, with each packet

having no relationship to any other packet.

Page 14: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1414

Kyung Hee University

19.2 Addressing19.2 Addressing

For a host to communicate with any other host

Need a universal identification system

Need to name each host

Internet address or IP address is a 32-bit address that

uniquely defines a host or a router on the internet

The IP addresses are unique in the sense that two

devices can never have the same address. However, a

device can have more one address.

Page 15: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1515

Kyung Hee University

NotationNotation

Binary notation

01110101 10010101 00011101 11101010

32 bit address, or a 4 octet address or a 4-byte address

Decimal point notation

Page 16: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1616

Kyung Hee University

Notation (cont’d)Notation (cont’d)

Hexadecimal NotationHexadecimal Notation

- 8 hexadecimal digits- 8 hexadecimal digits

- Used in network programming- Used in network programming

0111 0101 1001 0101 0001 1101 1110 1010

75 95 1D EA

0x75951DEA

Page 17: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1717

Kyung Hee University

Classful AddressingClassful Addressing Occupation of address space

In classful addressing, the address space is divided into five classes: A, B, C, D, and E.

Finding the class in binary notation

Page 18: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1818

Kyung Hee University

Classful Addressing (cont’d)Classful Addressing (cont’d)

Finding the address class

Page 19: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

1919

Kyung Hee University

Classful Addressing (cont’d)Classful Addressing (cont’d)

Finding the class in decimal notation

Page 20: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2020

Kyung Hee University

Example 4Example 4

Find the class of each address:

a. 227.12.14.87

b. 252.5.15.111

c. 134.11.78.56

Solution

a. The first byte is 227 (between 224 and 239); the class is D.

b. The first byte is 252 (between 240 and 255); the class is E.

c. The first byte is 134 (between 128 and 191); the class is B.

Page 21: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2121

Kyung Hee University

Netid and HostidNetid and Hostid

Each IP address is made of two parts; netid and hostid.

Netid defines a network; hostid identifies a host on that network.

Page 22: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2222

Kyung Hee University

Netid and Hostid (cont’d)Netid and Hostid (cont’d)

IP addresses are divided into five different classes: A, B, C, D, and E

Page 23: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2323

Kyung Hee University

Classes and Blocks Blocks in class A

Class A is divided into 128 blocks with each block having a different netid.

Millions of class A addresses Millions of class A addresses are wasted.are wasted.

Page 24: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2424

Kyung Hee University

Classes and Blocks (cont’d) Class B is divided into 16,384 blocks with each block having a diffe

rent netid

Many class B addresses Many class B addresses are wasted.are wasted.

Page 25: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2525

Kyung Hee University

Classes and Blocks (cont’d)

Class C is divided into 2,097,152 blocks with each block having a diff

erent netid.

The number of addresses in The number of addresses in a class C block a class C block is smaller than is smaller than the needs of most the needs of most organizationsorganizations

Page 26: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2626

Kyung Hee University

Classes and Blocks (cont’d)

Class D addresses are used for multicasting;

there is only one block in this class.

Class E addresses are reserved for special purposes;

most of the block is wasted.

Page 27: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2727

Kyung Hee University

Network AddressNetwork Address

The network address is the first address.

The network address defines the network to the rest of t

he Internet.

Given the network address, we can find the class of th

e address, the block, and the range of the addresses in

the block

In classful addressing, the network address

(the first address in the block) is the one that is assigne

d to the organization.

Page 28: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2828

Kyung Hee University

Network Address (cont’d)Network Address (cont’d)

Network address : an address with the hostid all set to 0s

Page 29: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

2929

Kyung Hee University

A Sample Internet with Classful AddressA Sample Internet with Classful Address

Token Ring LAN (Class C), Ethernet LAN (Class B), Ethernet LAN (Class A) ,

Point-to-point WAN, A Switched WAN

Page 30: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3030

Kyung Hee University

Subnetting and SupernettingSubnetting and Supernetting

Subnetting

A network is divided into several smaller networks with each subnetwork (or subnet) having its subnetwork address

Supernetting

Combining several class C addresses to create a larger range of addresses

IP Addresses are designed with two levels of hierarchy

Page 31: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3131

Kyung Hee University

SubnettingSubnetting

Classes A, B, C in IP addressing are designed with two levels of hierarchy (not subnetted)

Netid and Hostid

Page 32: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3232

Kyung Hee University

Subnetting (cont’d)Subnetting (cont’d) Further division of a network into smaller networks called subnetworks

R1 differentiating subnets

Page 33: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3333

Kyung Hee University

Subnetting (cont’d)Subnetting (cont’d)

Three levels of hierarchy : netid, subnetid, and hostid

Page 34: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3434

Kyung Hee University

Subnetting (cont’d)Subnetting (cont’d)

Three steps of the routing for an IP datagram

Delivery to the site, delivery to the subnetwork, and delivery to the host

Hierarchy concept in a telephone number

031

Page 35: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3535

Kyung Hee University

Default MasksDefault Masks

Class In BinaryIn Dotted-

DecimalUsing Slash

A11111111 00000000 00000000 00000000

255.0.0.0 /8

B11111111 11111111 00000000 00000000

255.255.0.0 /16

C 11111111 111111111 11111111 00000000 255.255.255.0 /24

• When a router receives a packet, it needs to route it• Uses mask to determine the subnetwork address• Routers outside the organization use default mask• Routers inside use a subnet mask

Page 36: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3636

Kyung Hee University

Comparison of a default mask and a subnet mask

• Number of subnets is determined by number of extra 1s in the subnet mask.

• 2n = 23 = 8 subnets

Page 37: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3737

Kyung Hee University

Supernetting Supernetting

A block of class x addresses

For example,

An organization that needs 1,000 addresses can be granted four class C addresses

Page 38: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3838

Kyung Hee University

Supernetting (cont’d)Supernetting (cont’d)

4 class C addresses combine to make one supernetwork

Page 39: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

3939

Kyung Hee University

19.3 Routing 19.3 Routing

Next-hop routing

Page 40: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4040

Kyung Hee University

Routing (cont’d)Routing (cont’d)

Network-specific routing

• Don’t have an entry for every host connected to the same

physical network

• Instead, only have one entry to define the destination network

Page 41: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4141

Kyung Hee University

Routing (cont’d)Routing (cont’d)

Host-specific routing

Page 42: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4242

Kyung Hee University

Routing (cont’d)Routing (cont’d)

Default routing

Page 43: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4343

Kyung Hee University

Static and Dynamic Routing TablesStatic and Dynamic Routing Tables

Static routing table : containing information entered

manually

Dynamic routing table

updating periodically using one of the dynamic routing protocols such as RIP, OSPF, or BGP

Whenever there is a change in the Internet, the dynamic routing protocols update all the tables in the routers.

Page 44: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4444

Kyung Hee University

20.2 IP datagram20.2 IP datagram

Page 45: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4545

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Version : for IP version4, it is 4

Header Length : Defining the length of the datagram

header in 4 byte words

Page 46: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4646

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Differentiated Services

The first 6 bits : codepoint subfield (DSCP : differentiated services code point)

Values for codepoints

Category Codepoint Assigning Authority

1 XXXXX0 Internet

2 XXXX11 Local

3 XXXX01 Temporary or experiment

Page 47: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4747

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Total Length : head + data

Defining the total length of the datagram including the header

Length of data = total length – header length

Limited to 65,535 (216 – 1) bytes

Encapsulation of a small datagram in an Ethernet Frame

Page 48: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4848

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d) Fields related to fragmentation

Identification : 16 bit-field Datagram id that is originated by the source host

– Therefore, Source IP address + datagram id (identification) All fragments having same identification number Identification No. to be used for the destination in

reassembling the datagram

Flags : 3 bit-field D : Do not fragment (1)

– If it can not pass the datagram through any available physical network, it discards the datagram and send ICMP error message to the source host

M : More fragment (0) – 0 : last fragment or only fragment

Page 49: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

4949

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d) Fragmentation offset : 13-bit field

Showing relative position of this fragment with respect to the whole datagram

Measured in units of 8 bytes : forcing hosts or routers that fragment datagrams to choose the size of each fragment so that the first byte number is divisible by eight

Page 50: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5050

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Time to live

Used to control the maximum number of hops (routers) visited by the datagram

If the value is Zero, the routers discarded If the source wants to confine the packet to the local

network, it can store 1 in this field

Page 51: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5151

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Fragmentation

The format and size of the received frame depend on the protocol used by the physical network

* MTU (Maximum Transfer Unit) : When a datagram is encapsulated in a frame, the total size of the datagram must be less than this maximum size

Page 52: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5252

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

MTUs for different networks

Protocol MTU

Hyperchannel 65,535

Token ring (16Mbps) 17,914

Token ring (4Mbps) 4,464

FDDI 4,352

Ethernet 1,500

X.25 576

PPP 296

• Hyperchannel : Network Systems Corporation, 1988 (RFC 1044)

Page 53: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5353

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Value Protocol1 ICMP2 IGMP6 TCP8 EGP

17 UDP89 OSPF

Protocol

Defining the higher level protocol that uses the services of the IP layer

TCP, UDP, ICMP, and IGMP Multiplexing data from different higher level protocols

Page 54: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5454

Kyung Hee University

IP Datagram (cont’d)IP Datagram (cont’d)

Example of Checksum Calculation

Page 55: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5555

Kyung Hee University

Page 56: 1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible

5656

Kyung Hee University

20.4 IPv6 Address20.4 IPv6 Address

IPv6 address consists of 16 octets; it is 128 bits long