53
Network Layer 2019, Lecture #5 Kaan Bür ETSF15 – Communication Systems and Networks

Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network Layer

2019, Lecture #5Kaan Bür

ETSF15 – Communication Systems and Networks

Page 2: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Previously on ETSF15

• Access methods

– Channelized, controlled, random (CSMA/CD)

• LAN topologies, Ethernet

– Evolution of local area networks

• Wireless LAN

– Hidden terminal problem

– Collision avoidance (CSMA/CA)

2019-02-18 ETSF15 – Communication Systems and Networks 2

Medium Access Control Sublayer

Page 3: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network layer

• Principles of digital communications– From electrical signals to bits to packets

• Using the physical infrastructure– Network access

• Finding your way– Addressing, routing

• Making use of it all– Applications

2019-02-18 ETSF15 – Communication Systems and Networks 3

Page 4: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network Layer

• The Internet[S1.5]

• Addressing, routing[S14.1-4, S19.1-2]

• Internet Protocol, IPv4 & IPv6[S14.1-4]

*[Kihl & Andersson: 6.1-3, 7.1-5, 7.8, 8.2-3]

2019-02-18 ETSF15 – Communication Systems and Networks 4

Page 5: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Internet administration

Source:http://www.hill2dot0.com2019-02-18 ETSF15 – Communication Systems and Networks 5

Page 6: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Internet architecture

2019-02-18 ETSF15 – Communication Systems and Networks 6

NAPNAP

Access networks

Backbone networks

Page 7: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

TCP/IP model and data units CORRECTION

2019-02-18 ETSF15 – Communication Systems and Networks 7

DATAGRAM

PACKET

FRAME

SEGMENT

Page 8: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Host-to-host delivery

• Multiple applications even on the same host

2019-02-18 ETSF15 – Communication Systems and Networks 8

Page 9: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network layer

• L3– end-to-end

• L2– hop-by-hop

2019-02-18 ETSF15 – Communication Systems and Networks 9

Page 10: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network layer: Routing

• L3 is end-to-end

Two functions:❶ Addressing❷ Feedback2019-02-18 ETSF15 – Communication Systems and Networks 10

Page 11: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

SA DA Data SA DA Data

Network layer: Router

• Internetworking device– Passes data packets between networks– Checks Network Layer addresses– Uses Routing/forwarding tables

Two functions:❶ Routing❷ Forwarding

2019-02-18 ETSF15 – Communication Systems and Networks 11

Page 12: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Routing

• Choosing the optimal path– Using a cost metric

• Sharing information– Central– Distributed

• Algorithms– Rules and procedures– Updates

2019-02-18 ETSF15 – Communication Systems and Networks 12

Page 13: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Common Cost Metrics

• Alternatives at the link level– Hop count– Inverse of the link bandwidth– Delay– Dynamically calculated – Administratively assigned– Combination

• Traffic monitored à metrics adjusted

2019-02-18 13ETSF15 – Communication Systems and Networks

Page 14: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

2019-02-18

Flooding

• Incoming packets copied out on all other ports• To break loops: All packets must have a hop

counter.

14

Switch

ETSF15 – Communication Systems and Networks

Page 15: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Routing algorithm

• Find route with least cost between source and destination.

• Update routing tables

2019-02-18 ETSF15 – Communication Systems and Networks 15

Page 16: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Distance Vector Routing Algorithm

• Best path info shared locally– Periodically– Upon any change

• Routing tables updated for– New entries– Cost changes

2019-02-18 16ETSF15 – Communication Systems and Networks

Page 17: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Updating a Routing Table

2019-02-18 ETSF15 – Communication Systems and Networks 17

to C (+2)

Page 18: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Updating Algorithm (Bellman-Ford)if (advertised destination not in table)

{

add new entry // rule #1

}

else if (adv. next hop = next hop in table)

{

update cost // rule #2

}

else if (adv. cost < cost in table)

{

replace old entry // rule #3

}2019-02-18 18ETSF15 – Communication Systems and Networks

Page 19: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Completed Routing Tables

2019-02-18 ETSF15 – Communication Systems and Networks 19

Page 20: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Link State Routing Algorithm

• Local topology info flooded globally– Periodically– Upon any change

• Routing tables updated for– Link state changes– Cost changes

2019-02-18 20ETSF15 – Communication Systems and Networks

Page 21: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Initial Link State Knowledge

2019-02-18 ETSF15 – Communication Systems and Networks 21

Page 22: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Tree Generation Algorithm (Dijkstra)put yourself to tentative list

while tentative list not empty

{

pick node which can be reached

with least cumulative cost

add it to your tree*

put its neighbours to tentative list**

with cumulative costs to reach them

}*(a.k.a. permanent list)**(if not already there)

2019-02-18 22ETSF15 – Communication Systems and Networks

Page 23: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Building a Shortest Path Tree

2019-02-18 23ETSF15 – Communication Systems and Networks

• After flooding• Take: A

Page 24: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

See you in 15’ :)

• After the break– IPv4– Addressing, forwarding– Fragmentation– IPv6

2019-02-18 ETSF15 – Communication Systems and Networks 24

Page 25: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Network layer protocols

• We need a universal address system. This is called the network address.

• We need rules for data forwarding. This is called routing.

• We need entities connecting several networks together and forwarding data between them. These are called routers.

2019-02-18 ETSF15 – Communication Systems and Networks 25

Page 26: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Internet Protocol

IPv4• Addressing scheme

– Hierarchy– Configuration– Lookup

• Packet format

IPv6• Larger address space• Better header format

– Extendible– More secure

• Support for QoS

2019-02-18 ETSF15 – Communication Systems and Networks 26

Page 27: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Internet

• All networks that are part of Internet have one thing in common:They all use the same network protocol, Internet Protocol (IP)!

• They do not need to use the same link protocols, which means that all kinds of networks can be part of Internet.

• The protocol framework for Internet is called the TCP/IP model.

2019-02-18 ETSF15 – Communication Systems and Networks 27

Page 28: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

TCP/IP model

• Sometimes illustrated with a hourglass.

• IP can be used on all types of networks

• This has made Internet what it is today.

2019-02-18 ETSF15 – Communication Systems and Networks 28

Page 29: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

IPv4 addresses

• 32 bits = 4 bytes• 232 = (28)4 = 2564 = 4 294 967 296• Classful vs. classless hierarchy

• Notations– Dotted decimal– Slash (CIDR)

2019-02-18 ETSF15 – Communication Systems and Networks 29

Page 30: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Classful addressing

• Five address classes defined: A, B, C, (D and E)

2019-02-18 ETSF15 – Communication Systems and Networks 30

Page 31: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Classful addressing

• Organizations can only get addresses in one of the predefined blocks.

2019-02-18 ETSF15 – Communication Systems and Networks 31

NOT ENOUGH!

Page 32: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Address depletion

• Classful addressing defined as there were very few networks connected to the Internet.

• With the growth of Internet, the address classes didn’t match the reality.

• Subnetting and supernetting was introduced. – Class A and B address blocks divided into subnets.– Several Class C address blocks combined into

larger blocks called supernets.

2019-02-18 ETSF15 – Communication Systems and Networks 32

Page 33: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Classless addressing

• Addresses in blocks– Block size power of 2

– N = 232-n

– First address divisible by N

2019-02-18 ETSF15 – Communication Systems and Networks

NETID HOSTID

33

N

Page 34: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Exercise: Classless addressing

• CIDR = slash notation with mask /n• 205.16.37.39/28

2019-02-18 ETSF15 – Communication Systems and Networks 34

Page 35: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

IPv4 packet

2019-02-18 ETSF15 – Communication Systems and Networks 35

Page 36: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Maximum packet size

2019-02-18 ETSF15 – Communication Systems and Networks 36

IP packet

Page 37: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Fragmentation

• Needed when IP packet size > MTU

• IPv4

– Performed by the router meeting the problem

• IPv6

– Performed by the source router only

• Defragmentation by destination host

2019-02-18 ETSF15 – Communication Systems and Networks 37

Page 38: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Fragmentation field

2019-02-18 ETSF15 – Communication Systems and Networks 38

Page 39: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Fragmentation offset

• Relative location of fragments• 13 bits < 16 bits à /8

2019-02-18 ETSF15 – Communication Systems and Networks 39

Page 40: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Fragmentation example

2019-02-18 ETSF15 – Communication Systems and Networks 40

Page 41: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Forwarding: Address aggregation

2019-02-18 ETSF15 – Communication Systems and Networks 41

Page 42: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Forwarding: Longest mask matching

2019-02-18 ETSF15 – Communication Systems and Networks 42

Page 43: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Forwarding: Hierarchical routing

2019-02-18

ISP

ETSF15 – Communication Systems and Networks 43

Page 44: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Problems with IPv4

• Address space too small• Not designed for real-time applications• No support for encryption and authentication

2019-02-18 ETSF15 – Communication Systems and Networks

IPv644

Page 45: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Some advantages with IPv6

• Larger address space: 128 bit-long addresses.• Better header format: base header has

constant length (40 bytes). Options can be inserted when needed.

• Support for more security: Encryption and authentication options.

• Support for real-time applications: Special handling of datagram can be requested.

2019-02-18 ETSF15 – Communication Systems and Networks 45

Page 46: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

IPv6 addresses

• 128 bits = 16 bytes• 2128 = 232 · 296 > 3·1035

• Notations

2019-02-18 ETSF15 – Communication Systems and Networks 46

Page 47: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Global unicast addresses

• Identify individual computers

2019-02-18 ETSF15 – Communication Systems and Networks

TYPEAREA

ISPORGANISATION

47

Page 48: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

• Simpler base header, flexible for extensions

IPv6 packet

2019-02-18 ETSF15 – Communication Systems and Networks 48

Page 49: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

IPv6 extension headers

2019-02-18 ETSF15 – Communication Systems and Networks 49

Page 50: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Traffic Classes à Packet priorities

• 0 .. 7– Congestion

controlled

• 8 .. 15– Non-congestion

controlled2019-02-18 ETSF15 – Communication Systems and Networks 50

Page 51: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

IPv6 and QoS

Flow label• Identification of a stream

– TCP sessions

– Virtual connections

• Processing

– Flow label table

– Forwarding table

• Routing

– Algorithms still necessary

– But not run for every packet!

Traffic class• Classification of packets

– Queueing schemes

– Relation to delay

• TCP vs. UDP

– Congestion-controlled

– Non-congestion-controlled

• Other protocols

– RTP

– RSVP

2019-02-18 ETSF15 – Communication Systems and Networks

CROSS-LAYER?

51

Page 52: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Transition: IPv4 à IPv6

• Cannot happen overnight– Too many independent systems

– Economic cost

– IPv4 address space lasted longer than expected

• Coexisence needed

2019-02-18 ETSF15 – Communication Systems and Networks 52

Page 53: Network Layer - Lunds tekniska högskola · 2019-02-18 · Network layer protocols •We need a universal address system. This is ... NETID HOSTID 33 N. Exercise:Classless addressing

Summary: Network layer

• Internet architecture, internetworking– End-to-end principle, routing

• Internet Protocol– Addressing, packet format– IPv4 vs IPv6– Fragmentation– Forwarding

2019-02-18 ETSF15 – Communication Systems and Networks 53