Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Network Layer
2019, Lecture #5Kaan Bür
ETSF15 – Communication Systems and Networks
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
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
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
Internet administration
Source:http://www.hill2dot0.com2019-02-18 ETSF15 – Communication Systems and Networks 5
Internet architecture
2019-02-18 ETSF15 – Communication Systems and Networks 6
NAPNAP
Access networks
Backbone networks
TCP/IP model and data units CORRECTION
2019-02-18 ETSF15 – Communication Systems and Networks 7
DATAGRAM
PACKET
FRAME
SEGMENT
Host-to-host delivery
• Multiple applications even on the same host
2019-02-18 ETSF15 – Communication Systems and Networks 8
Network layer
• L3– end-to-end
• L2– hop-by-hop
2019-02-18 ETSF15 – Communication Systems and Networks 9
Network layer: Routing
• L3 is end-to-end
Two functions:❶ Addressing❷ Feedback2019-02-18 ETSF15 – Communication Systems and Networks 10
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
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
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
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
Routing algorithm
• Find route with least cost between source and destination.
• Update routing tables
2019-02-18 ETSF15 – Communication Systems and Networks 15
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
Updating a Routing Table
2019-02-18 ETSF15 – Communication Systems and Networks 17
to C (+2)
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
Completed Routing Tables
2019-02-18 ETSF15 – Communication Systems and Networks 19
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
Initial Link State Knowledge
2019-02-18 ETSF15 – Communication Systems and Networks 21
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
Building a Shortest Path Tree
2019-02-18 23ETSF15 – Communication Systems and Networks
• After flooding• Take: A
See you in 15’ :)
• After the break– IPv4– Addressing, forwarding– Fragmentation– IPv6
2019-02-18 ETSF15 – Communication Systems and Networks 24
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
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
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
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
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
Classful addressing
• Five address classes defined: A, B, C, (D and E)
2019-02-18 ETSF15 – Communication Systems and Networks 30
Classful addressing
• Organizations can only get addresses in one of the predefined blocks.
2019-02-18 ETSF15 – Communication Systems and Networks 31
NOT ENOUGH!
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
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
Exercise: Classless addressing
• CIDR = slash notation with mask /n• 205.16.37.39/28
2019-02-18 ETSF15 – Communication Systems and Networks 34
IPv4 packet
2019-02-18 ETSF15 – Communication Systems and Networks 35
Maximum packet size
2019-02-18 ETSF15 – Communication Systems and Networks 36
IP packet
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
Fragmentation field
2019-02-18 ETSF15 – Communication Systems and Networks 38
Fragmentation offset
• Relative location of fragments• 13 bits < 16 bits à /8
2019-02-18 ETSF15 – Communication Systems and Networks 39
Fragmentation example
2019-02-18 ETSF15 – Communication Systems and Networks 40
Forwarding: Address aggregation
2019-02-18 ETSF15 – Communication Systems and Networks 41
Forwarding: Longest mask matching
2019-02-18 ETSF15 – Communication Systems and Networks 42
Forwarding: Hierarchical routing
2019-02-18
ISP
ETSF15 – Communication Systems and Networks 43
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
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
IPv6 addresses
• 128 bits = 16 bytes• 2128 = 232 · 296 > 3·1035
• Notations
2019-02-18 ETSF15 – Communication Systems and Networks 46
Global unicast addresses
• Identify individual computers
2019-02-18 ETSF15 – Communication Systems and Networks
TYPEAREA
ISPORGANISATION
47
• Simpler base header, flexible for extensions
IPv6 packet
2019-02-18 ETSF15 – Communication Systems and Networks 48
IPv6 extension headers
2019-02-18 ETSF15 – Communication Systems and Networks 49
Traffic Classes à Packet priorities
• 0 .. 7– Congestion
controlled
• 8 .. 15– Non-congestion
controlled2019-02-18 ETSF15 – Communication Systems and Networks 50
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
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
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