PowerPoint Presentation
COMP30023 – Computer Systems
Copyright By PowCoder代写 加微信 powcoder
©2022 University of Melbourne
Internet (Network) Layer – IP Addresses
and Packet Switching
Dr Lachlan application to transport Layers
© University of Melbourne
• Network / Internet layer
• Addresses and Packet switching
• Subnets and network address translation (NAT)
• Internet layer control protocols
Next four lectures
© University of Melbourne
• Initial look at the network layer
• High level discussion of quality of service
• IP addressing
© University of Melbourne
• Role: get data from the source all the way to the destination
• May not be in a single hop (point-to-point link)
• Traffic must be routed efficiently
• This is performed by network devices called routers
• Nodes must be given names (addresses)
Internet (network) Layer
© University of Melbourne
Connecting multiple networks
Internetworking and Routing
© University of Melbourne
TN 6th 5-46
• Most network layer code runs on routers
• We will refer to the protocol data units as packets
• What types of services does the network layer provide?
• Connectionless
• Packet switching (Internet Protocol – IP)
• Minimum required service: “send packet”
• Called “datagram” network
• Connection-oriented
• (virtual) Circuit Switching
• Asynchronous Transfer Mode – ATM
• MultiProtocol Label Switching MPLS
• Called “virtual circuit” network
• These usually act as a single “link” of an IP network
Network Layer
© University of Melbourne
• The internet is a packet switched network
• Host H1 wants to send a packet to H2
1. Transmits it to the nearest router (A)
2. The packet is buffered while it is arriving, and the checksum is verified
3. If valid, the packet is stored until the outgoing interface is free
4. The router forwards the packet onto the next router in the path
5. Repeat 2-4
Store-and-Forward Packet Switching
© University of Melbourne
TN 6th 5-1
Packet forwarding –
Connectionless
© University of Melbourne
Forwarding tables
(also called
routing tables)
Paths can change
for packets in
the same transport
layer connection
TN 6th 5-2
Packet forwarding –
Connection-oriented
© University of Melbourne
Forwarding table:
“In”: connection ID
“Out”: next hop and
new connection number
Connection number
is local to a hop
TN 6th 5-3
Pros and cons of connections
© University of Melbourne
Issue Datagram Network Virtual Circuit
Type Connectionless Connection-oriented
Addressing (-) Each packet has full
source and destination
(+) Each packet contains a
short VC number
State + Routers do not hold state
information about
connections
– Each VC requires router
table space.
– Router reboots a problem.
Routing Each packet independently Defined at set-up
Quality of Service – Difficult + Easy if enough resources
Congestion control – Difficult + Easy if enough resources
Link failure recover + Simple – Extra work
• Widely deployed Virtual Circuit (connection-oriented) Network
Layer Protocol (below the internet sublayer)
• MPLS network is one IP hop
• Primary purpose is Quality of Service
• Prioritising traffic
• Service Level Agreements for network performance
• Reliable connectivity with known parameters
• Popular with businesses that want to connect multiple sites and
phone companies carrying voice traffic
• Expensive: Price roughly 20-100 times more per Mbps than a
standard internet connection. (Cost is much more similar.)
• https://www.networkworld.com/article/2222196/why-does-mpls-cost-
so-much-more-than-internet-connectivity-.html
MultiProtocol Label Switching
© University of Melbourne
https://www.networkworld.com/article/2222196/why-does-mpls-cost-so-much-more-than-internet-connectivity-.html
• Why is Quality of Service (QoS) important?
• Not all services are equally important or robust to network delay
• VoIP vs file downloads
• VPN connections vs web browsing
• Within your own network, or within a single administered
network (ISP), services can be prioritised
• Own network – typically explicitly
• Shared network – typically implicitly (ISP traffic shaping)
• In the case of explicit prioritisation, the Differentiated Services
header can be used to define classes of traffic
• Useful in an office building with a network that carries both
internet and telephony traffic
Quality of Service
© University of Melbourne
• Be aware that
• connection-oriented services exist, and
• the concept of Quality of Service is important
• Our focus will be on the connectionless Internet Protocol
that forms the backbone of the internet
Network Layer
© University of Melbourne
• Designed with a number of principles in mind, including:
– Something that works OK is better than an ideal standard “in progress”
• Standard of “OK” has gone up as the Internet has become vital
– Keep it simple – Occam’s Razor
– Be strict when sending and tolerant when receiving
• E.g., web browsers handle pages with invalid HTML
– Make clear choices – don’t have different approaches in a standard
– Avoid static options and parameters – negotiate them at runtime
– (New principle: Think about scalability)
• “Best effort”, not guaranteed performance
Internet Protocol
© University of Melbourne
• Responsible for moving the packets through the various
networks from source to destination host
• Multiple paths through the network
– Important for redundancy
• Routing algorithms are used to determine best path
– We will look into these more next week
• Nothing guaranteed – just “best effort”
Internet Protocol
© University of Melbourne
IP Version 4 Protocol (IPv4)
© University of Melbourne
Field Usage
Version Protocol version 4
(This field is also in IPv6)
IHL Header length in 32 bit words;
min 5, max 15
Differentiated
6 bits for service class, 2 bits for
congestion control (ECN)
Total length Including payload, max 65,535
Identification, DF,
MF, Fragment Offset
Used in the handling of
fragmentation
Time to live (TTL) Countdown of hops, at zero packet
is discarded
Protocol Transport layer service
(TCP/UDP/SCTP/DCCP/etc.)
Source and
Destination
IPv4 address
Options Rarely used and poorly supported
TN 6th 5-47
• 32-bit number
• Expressed in decimal notation, each byte is shown as a
decimal, separated by a period, 172.22.44.10 (0xAC162C0A)
• 0.0.0.0 is lowest, 255.255.255.255 is highest
• IP address allocation responsibility of Internet Corporation
for Assigned Names and Numbers (ICANN) by delegation to
IANA and Regional Internet Registries (RIR’s)
• IP addresses are given to interfaces not hosts, i.e. a host
with multiple network cards will have multiple IP addresses
• Supply of IPv4 addresses has basically been exhausted
IPv4 Addresses
© University of Melbourne
• Unicast: One destination (“normal” address)
• Broadcast: Send to everyone
• Multicast: Send to a particular set of nodes
– Used for streaming video of live events
• Anycast: Send to any one of a set of addresses
– Used for database queries, like DNS, NTP
• Geocast: Send to all users in a geographic area
– “Location aware” services
– Send ad to those in store
– Send warning to those near a hazard
2022© University of Melbourne 21
Types of address
Were thought to be
the only types
Not widely used.
To show that
the above aren’t all
• Unicast: One destination (“normal” address)
• Broadcast: Send to everyone
• Multicast: Send to a particular set of nodes
– Used for streaming video of live events
• Anycast: Send to any one of a set of addresses
– Used for database queries, like DNS, NTP
• Geocast: Send to all users in a geographic area
– “Location aware” services
– Send ad to those in store
– Send warning to those near a hazard
2022© University of Melbourne 22
Types of address
Were thought to be
the only types
Not widely used.
To show that
the above aren’t all
• Originally IP addresses were allocated based on classes
• Routing was performed based on the class, which could be
derived from the first part of the address
IPv4 Addresses – Classes
(no longer used, but spoken of)
© University of Melbourne
TN 6th 5-54
• Classes simplify routing
– size of “network” field is implicit in the address
• Wasteful. Networks often much bigger than needed
– Network with 260 nodes must be class B with 65,536 addresses
• Classless InterDomain Routing
– Each interface / route explicitly specifies which bits are the
“network” field
– Network with 260 nodes only needs 9 bits for “host” field
512 addresses
Can have 128 times as many of these networks as class B networks
IP Addresses – CIDR
© University of Melbourne
• Hierarchical – encodes the network and host number
– Network in top bits
– Host in bottom bits
• Assigned to networks in blocks, the network part will be the
same for all hosts on that network
– A network corresponds to a contiguous block of IP address space,
called a prefix
– Prefixes are written as the lowest IP address followed by a slash and
the size of the network portion – 192.0.2.0/24
IP Addresses – CIDR
© University of Melbourne
TN 6th 5-49
• In the case of 192.0.2.0/24
– 24 bits are for the network 192.0.2.0
– Leaving 8 bits for hosts – up to 256 addresses
• In the case of 10.0.0.0/8 (reserved private block)
– 8 bits are for the network 10.0.0.0
– Leaving 24 bits for hosts – up to 16,777,216 addresses
• Can also be written as a subnet mask, a binary mask of 1’s
– In the case of /24: the subnet mask is 255.255.255.0
IP Addresses – Blocks
© University of Melbourne
• Network number = network mask (bitwise-AND) IP address
• This is crucial for efficient routing on the internet
– Since networks are assigned in blocks, intermediary routers need
only maintain routes for the prefixes, not every individual host
– Only when the packet arrives at the destination network does the
host portion need to be read
IP Addresses – Prefixing
© University of Melbourne
IP Addresses – Route aggregation
© University of Melbourne
TN 6th 5-52, 5-53
• Aggregation is performed automatically
• Currently it roughly halves
the size of the routing table
• Prefixes can overlap, in which case the longest matching
prefix is selected
2022© University of Melbourne 29
Special IP Addresses
Link local / zero config
169.254.0.0 – 169.254.255.255 169.254.0.0/16 (255.255.0.0) 65,536
Private address range Prefix & Mask Available Addresses
10.0.0.0 – 10.255.255.255 10.0.0.0/8 (255.0.0.0) 16,777,216
172.16.0.0 – 172.31.255.255 172.16.0.0/12 (255.240.0.0) 1,048,576
192.168.0.0 – 192.168.255.255 192.168.0.0/16 (255.255.0.0) 65,536
/Placeholder for “invalid” address
TN 6th 5-55
• Designed over 20 years ago to address the problem of
exhausting the IPv4 address space
• Whilst solving that problem some other changes were made
– Simpler header – allows faster processing
– Improved security – now back-ported to IPv4
– Further Quality of Service support
• IPv6 addresses are 128 bits
– Unlikely ever to run out…
– …unless new wasteful allocation schemes are used.
© University of Melbourne
2022© University of Melbourne 31
IPv6 Header
Field Usage
Differentiated
6 bits for service class, 2 bits for
congestion control (ECN)
Flow label Pseudo-Virtual Circuit identifier
Bytes after the 40 byte header
Next header Used to specify additional
headers or Protocol (TCP/UDP)
Hop limit Same as TTL (Time To Live)
Source and
Destination
16 bytes IPv6 addresses
TN 6th 5-57
• Written as 8 groups of (up to) 4 hex digits
– 8000:0000:0000:0000:0123:4567:89AB:CDEF
• Can be optimised by stripping one group of consecutive 0’s
– 8000::123:4567:89AB:CDEF
• Backwards compatibility with IPv4 is achieved with
– ::ffff:192.31.2.46 (note the mix of hex with decimal)
• Still not widely deployed
– Google measures IPv6-capable requesters,
https://www.google.com/intl/en/ipv6/statistics.html
– still around 40% globally, (~28% in Australia)
• Fairly widely supported – likely to see a continued growth
2022© University of Melbourne 32
IPv6 Addressing
https://www.google.com/intl/en/ipv6/statistics.html
• One of the disadvantages of a
hierarchical address space is that it
can be quite wasteful if not carefully
assigned, i.e. large parts of the
address space unused if blocks badly
• Combined with the scarcity
(exhaustion) of available IP
addresses, they have become a
valuable commodity
• Not intended to be sold, should
really be returned to the assigning
body for reallocation
• Early adopters of IPv6 were able to
sell their IPv4 address space at a
And finally…
© University of Melbourne
• The slides are based on slides prepared by
based on material developed previously by: ,
, , and .
• Some of the images included in the notes were supplied as
part of the teaching resources accompanying the text books
listed in lecture 1.
– (And also) Computer Networks, 6th Edition, Tanenbaum A., Wetherall. D.
https://ebookcentral.proquest.com/lib/unimelb/detail.action?docID=6481879
• Textbook Reference: 4.1, 4.2.1, 4.3.1, 4.3.3, 4.3.5
Acknowledgement
© University of Melbourne
https://ebookcentral.proquest.com/lib/unimelb/detail.action?docID=6481879
Internet (Network) Layer – IP Addresses and Packet Switching
Next four lectures
Internet (network) Layer
Internetworking and Routing
Network Layer
Store-and-Forward Packet Switching
Packet forwarding –�Connectionless
Packet forwarding –�Connection-oriented
Pros and cons of connections
MultiProtocol Label Switching
Quality of Service
Network Layer
Internet Protocol
Internet Protocol
IP Version 4 Protocol (IPv4)
IPv4 Addresses
Types of address
Types of address
IPv4 Addresses – Classes�(no longer used, but spoken of)
IP Addresses – CIDR
IP Addresses – CIDR
IP Addresses – Blocks
IP Addresses – Prefixing
IP Addresses – Route aggregation
Special IP Addresses
IPv6 Header
IPv6 Addressing
And finally…
Acknowledgement
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com