0% found this document useful (0 votes)
55 views

Computer Networks and Operating Systems: Lecture No. 5 by Luminiţa SCRIPCARIU

This document contains a lecture on computer networks and operating systems. It discusses IPv4 addressing, including subnetting and calculating subnet masks. It also covers IPv6 addressing and the transition from IPv4 to IPv6 due to the depletion of available IPv4 addresses. Key topics include IPv4 subnetting, private vs public IP addresses, carrier-grade NAT, IPv6 address types and structures, and generating IPv6 addresses from MAC addresses. It aims to help students understand modern network and IP addressing fundamentals.

Uploaded by

Alexandru Istoc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Computer Networks and Operating Systems: Lecture No. 5 by Luminiţa SCRIPCARIU

This document contains a lecture on computer networks and operating systems. It discusses IPv4 addressing, including subnetting and calculating subnet masks. It also covers IPv6 addressing and the transition from IPv4 to IPv6 due to the depletion of available IPv4 addresses. Key topics include IPv4 subnetting, private vs public IP addresses, carrier-grade NAT, IPv6 address types and structures, and generating IPv6 addresses from MAC addresses. It aims to help students understand modern network and IP addressing fundamentals.

Uploaded by

Alexandru Istoc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

COMPUTER NETWORKS AND

OPERATING SYSTEMS
Lecture no. 5

by Luminiţa SCRIPCARIU
TO REMEMBER

3/25/2021 Luminiţa Scripcariu 2


FROM THE PREVIOUS COURSE

• How are IPv4 subnets defined?

• Calculus of the subnet address, the


host address range and the
broadcast subnet address

3/25/2021 Luminiţa Scripcariu 3


QUESTION 1
IP addresses are converted into MAC
addresses using:
 ARP
 BOOTP
 DHCP
 RARP

3/25/2021 Luminiţa Scripcariu 4


QUESTION 2
Packets are routed in the Internet
based on:
 private IP addresses
 public IP addresses
 MAC addresses
 URL

3/25/2021 Luminiţa Scripcariu 5


QUESTION 3
ARP client requests are sent using:
 broadcast IP address
 broadcast MAC address
 ARP server IP address
 ARP server MAC address

3/25/2021 Luminiţa Scripcariu 6


QUESTION 4
Which of the following statements about the
broadcast address is true?
 the IPv4 broadcast address has all the
network bits equal to ‘1’
 the IPv4 broadcast address has all the
host bits equal to ‘1’
 the IPv4 broadcast address has all the
host bits equal to ‘0’
 the IPv6 broadcast address has all the
host bits equal to ‘1’
3/25/2021 Luminiţa Scripcariu 7
QUESTION 5
How many bits are borrowed from
the host ID in order to define /22
subnets in 172.16.0.0 network?
6
 14
 16
 22

3/25/2021 Luminiţa Scripcariu 8


QUESTION 6

Write the subnet dotted-decimal mask


of 172.16.244.0/22 subnet:

...................................................

3/25/2021 Luminiţa Scripcariu 9


Key to the exercise

Subnet Mask: /22

11111111. 11111111.11111100.00000000

255.255.252.0

3/25/2021 Luminiţa Scripcariu 10


QUESTION 7
What is the decimal number of the
172.16.244.0/22 subnet?
 22
 61
 122
 244

3/25/2021 Luminiţa Scripcariu 11


QUESTION 8
Which is the broadcast address of the
172.16.244.0/22 subnet?
 172.16.244.255
 172.16.245.255
 172.16.247.255
 172.16.255.255

3/25/2021 Luminiţa Scripcariu 12


QUESTION 9
Which is the host#319 address from
the 172.16.244.0/22 subnet?
 172.16.244.300
 172.16.245.63
 172.16.247.255
 172.16.251.150

3/25/2021 Luminiţa Scripcariu 13


QUESTION 10
In 193.220.30.0 network the subnet
mask is 255.255.255.248. How
many host addresses can be
allocated?
6
 14
 30
 62

3/25/2021 Luminiţa Scripcariu 14


PROPOSED EXERCISE
Write the dotted-decimal subnet mask, the
host range and the broadcast address of the
subnet 192.168.230.32, defined by
borrowing 4 bits from the host ID.

3/25/2021 Luminiţa Scripcariu 15


EXERCISE
Calculate the hexadecimal value of the
checksum for an IPv4 packet of 1024B, sent
by TCP, with no options, no fragmentation,
TTL = 16, ToS = 0x.08, from 192.168.12.140
to 192.168.12.1.

3/25/2021 Luminiţa Scripcariu 16


CS=?
V=4 HL=5 ToS=8 0100.0101.0000.1000
TL=1024+20=1044 0000.0100.0010.1100
FI=0 0000.0000.0000.0000
FC=0 0000.0000.0000.0000
TTL=16 Protocol=6 0001.0000.0000.0110
SA 192.168.12.140 1100.0000.1010.1000
0000.1100.1000.1100
DA 192.168.12.1 1100.0000.1010.1000
0000.1100.0000.0001
CS (mod-2) 0101.0001.1010.1111

CS = 0x.51.AF
3/25/2021 Luminiţa Scripcariu 17
The Usage Grade of the IPv4
Addresses

IPv4 Address pool exhaustion was predicted to happen in 2011.

3/25/2021 Luminiţa Scripcariu 18


Regional International Registers (RIR)

• AfriNIC - African Network Information Centre - Africa


• ARIN - American Registry for Internet Numbers - United
States, Canada, parts of Caribbean region, Antarctica.
• APNIC - Asia-Pacific Network Information Centre - Asia,
Australia, New Zealand.
• LACNIC - Latin America and Caribbean Network
Information Centre - Latin America, other parts of the
Caribbean region
• RIPE NCC - Réseaux IP Européens Network
Coordination Centre - Europe, Russia, the Middle East,
Central Asia
3/25/2021 Luminiţa Scripcariu 19
Regional IP Registers (RIR) Status

https://ipv4.potaroo.net/plotend.png

”The IPv4 address space is a 32 bit field. There are 4,294,967,296


unique values, considered in this context as a sequence of 256 "/8s",
where each "/8" corresponds to 16,777,216 unique address values. ”
By Geoff Huston - http://www.potaroo.net/tools/ipv4/plotend.png, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=16199231

3/25/2021 Luminiţa Scripcariu 20


https://www.slideshare.net/apnic/iana-services-update-66747987
3/25/2021 Luminiţa Scripcariu 21
IPv4 Recovered Address Space
Last Updated 2019-03-01
Current Recovered IPv4 Pool
Registration Procedure(s)
Global Policy for Post Exhaustion IPv4 Allocation Mechanisms by the
IANA (Ratified 6 May 2012)

Start address End address Returned by Date recovered Status

160.20.241.0 160.20.241.255 APNIC 2012-08 RECOVERED

160.20.245.0 160.20.245.255 APNIC 2012-08 RECOVERED

192.47.28.0 192.47.28.255 APNIC 2012-08 RECOVERED

3/25/2021 Luminiţa Scripcariu 22


IPv4 Recovered Address in 2019

https://www.iana.org/assignments/ipv4-recovered-address-space/ipv4-recovered-address-space.xhtml

3/25/2021 Luminiţa Scripcariu 23


CGN
• Carrier-Grade NAT (CGN)

• Also known as Large-Scale NAT (LSN)

• Private IPv4 addresses are used inside


the provider’s network, from customer-
edge to the edge of the transport or carrier
network.
3/25/2021 Luminiţa Scripcariu 24
https://www.ripe.net/publications/news/about-ripe-ncc-and-ripe/the-ripe-ncc-has-run-out-of-ipv4-addresses

3/25/2021 Luminiţa Scripcariu 25


IPv6 or IPng
• IP next generation (RFC 4291)

• 16-Byte Address (128 bits)

• hexadecimal sequence written as 8 groups


of 2 octets or 4 digits separated by `:`

12FE:A3B0:4567:CD00:89CD:1031:1B2F:1120

• Wide address range (2128)

3/25/2021 Luminiţa Scripcariu 26


IPv6 Address Description
• 64-bit Network ID (8B)
• 64-bit Host ID (8B)
• Null sequences can be :: (once, for
the longest null sequence)
• A group of ‘0000’ can be written as a
single ‘0’.
• IPv6 is compatible to IPv4 (RFC 4038).

3/25/2021 Luminiţa Scripcariu 27


IPv6 Address Model
Assigned:
• link-local with FE80: as the prefix – generated by the local OS
- non-routable addresses
• site-local with FC00::/7 prefix (IPv4 reserves three site-local
ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) – routable
only within an organization
• Global routable addresses (like IPv4 public addresses).
/23 /36 /48 /64

Interface ID

Registry
ISP prefix
Site prefix
Subnet prefix
3/25/2021 Luminiţa Scripcariu 28
https://www.tutorialspoint.com/ipv6/ipv6_address_types.htm

3/25/2021 Luminiţa Scripcariu 29


Global Unicast Address
• This address type is equivalent to IPv4’s public
address. Global Unicast addresses in IPv6 are
globally identifiable and uniquely addressable.

• The most significant 48-bits are designated as


Global Routing Prefix which is assigned to
specific autonomous system (AS). The three
most significant bits of Global Routing Prefix is
always set to 001. Luminiţa Scripcariu
3/25/2021 30
Unique Local Address (ULA)
• These addresses are globally unique but are
not routed over the Internet
• It should be used in local communication.
• The local bit L is 1 so the prefix is FD. (L=0 is
not used).

3/25/2021 Luminiţa Scripcariu 31


Host ID
• 8 octets derived from the MAC address

• The 7th bit value from the first octet is changed

• 0x.FF.FE sequence is interposed between the


first three octets and the last 3 octets of the
MAC address:

3 octets (Producer ID): FF.FE:3 octets (Product ID)


3/25/2021 Luminiţa Scripcariu 32
Example
• MAC address:

00-16-CF - 42-9A-E4

• The IPv6 Host ID:

0216:CFFF:FE42:9AE4
The NETWORK ADDRESS
• In the network address, all the host bits
are ‘0’.
• The length of the network or subnet ID is
denoted as
::/number of network or subnet bits

3/25/2021 Luminiţa Scripcariu 34


Example
• IPv6 Host Address:
1234:0:0:AB00:0123:4567:89AB:CDEF
• Subnet ID:
1234:0:0:AB00::/56
• The equivalent subnet address:
1234::AB00:0:0:0:0/56
• The compact host IPv6 address:
1234::AB00:123:4567:89AB:CDEF/56
3/25/2021 Luminiţa Scripcariu 35
IPv4 – IPv6 Compatibility
• The IPv4 address can be written as a
hexadecimal sequence
Example: 172.16.0.1 = 0x.AC.10.00.01

IPv4-to-IPv6 address mapping can be done:


• ”6-to-4” mapping with the prefix
0:0:0:0:0:FFFF or ::FFFF
• Mixt mapping with 2002 prefix and with
‘0’s at the end.

3/25/2021 Luminiţa Scripcariu 36


3/25/2021 Luminiţa Scripcariu 37
Exercise
172.16.96.14 = 0x.AC.10.60.0E

IPv4-to-IPv6 6-to-4 mapping:


::FFFF:AC10:600E

Mixt mapping:
2002:AC10:600E::

3/25/2021 Luminiţa Scripcariu 38


Proposed exercise

• IPv4 Address:
192.168.12.100
• IPv6 address mapped as ‘6-to-4’ is:
0:0:0:0:0:FFFF:.........................
• By mixt mapping method:
2002:.......................................
EXERCISE
Write the address and the mask of the subnet
no. 120, defined in the IPv6 2002:C0A8::/32
network.
Deduce the IPv6 Host ID for an interface card
with the following MAC address:
AE:2D:03:95:A7:FB.
Write the IPv6 address of this interface as a
part of the above defined subnet.
3/25/2021 Luminiţa Scripcariu 40
NA 2002:C0A8::
NM /32
S#120
120 = 0111 1000 = 0x.78
S#120 2002:C0A8:0000:_____::/___ SM
MAC address AE:2D:03:95:A7:FB
AE = 1010 1110 -> 1010 1100 = A __
HID A__2D:03FF:FE95:A7FB
NIC IPv6 address:
2002:C0A8::_____:
3/25/2021
A__2D:03FF:FE95:A7FB/___
Luminiţa Scripcariu 41
REMARK:

This address is routable because its three


bits are 001.

2002:C0A8::7800:AC2D:3FF:FE95:A7FB/56

2 = 0010

3/25/2021 Luminiţa Scripcariu 42


PROPOSED EXERCISE
Write the address and the mask of the subnet
no. 90, defined in the IPv6 2002:C0A8::/32
network.
Deduce the IPv6 Host ID for an interface card
with the following MAC address:
A4.C3.F0.32.B9.22.
Write the IPv6 address of this interface as a
part of the above defined subnet.
3/25/2021 Luminiţa Scripcariu 43
IPv6 Packet Header

3/25/2021 Luminiţa Scripcariu 44


Remarks
• TTL becomes Hop Limit.
• IPv6 header does not have a checksum as
IPv4 header has.
• Messages are no more fragmented.
• The class of service is used to ensure the
Quality-of-Service (QoS).
• Localhost address is ::1/128.
• The all-‘0’ address is denoted as ::/128 and
it is called Anycast address.
3/25/2021 Luminiţa Scripcariu 45
What is a FLOW?
• A sequence of packets sent from a
particular source to a particular, unicast or
multicast, destination, with special options
of routing.
• The 20-bit flow label field from the IPv6
header is used to route packets with
special handling requests, like those sent
by real-time applications (voice, video,
gaming etc.)
3/25/2021 Luminiţa Scripcariu 46
New facts introduced by IPv6
• Broadcast is no more used.
• Multicast is used instead of broadcast
(prefix FF00::/8)
• The IP header has a constant length and
includes routing information.
• IPv6 addresses can be automatically
assigned, with or without a server, and
duplicated addresses are detected.
• IPsec is compulsory used for IPv6 networks.
• NAT is no more used.
3/25/2021 Luminiţa Scripcariu 47
New versions of other protocols
 ARP is replaced by Neighbour Discovery
proxy (ND Proxy) (RFC 4389)

 DHCPv6

 ICMPv6

 New versions of routing protocols are


used for IPv6.
3/25/2021 Luminiţa Scripcariu 48
Advantages of IPv6
• Wide address pool
• Automatic addressing based on MAC
address is allowed.
• Addresses can be locally allocated.
• Priority-based class-of-service facilitates the
delivery of multimedia packets: voice, RT
video, NRT video streaming, BE data,
scavenger class (BE=Best-Effort; RT=Real-
Time;NRT=NonRT).
• Subnets can be defined.
3/25/2021 Luminiţa Scripcariu 49
TRANSPORT PROTOCOLS

3/25/2021 Luminiţa Scripcariu 50


• TCP (Transmission Control Protocol)
connection-oriented protocol, ACK, SYN,
FIN, error-control, extended header
• UDP (User Datagram Protocol)
no-connection, reduced header (8 octets)
• SCTP (Stream Control Transmission
Protocol ) message-oriented protocol (RFC
4960).

3/25/2021 Luminiţa Scripcariu 51


About TCP
• Each message is segmented into smaller
sequences identified by SN - Sequence Number.
• Confirmation number (ACK n) – specifies the
correct reception of sequence no. (n-1) and
requests the next sequence no. n to be delivered.
• HLEN - Header Length is expressed as a multiple
of 4 octets, so it can be equal to 5 or 6, depending
on the existence of the options in the transport
header.
• The TCP data unit is called segment.
3/25/2021 Luminiţa Scripcariu 52
Protocol Ports (RFC 1700)
Protocol Port Number

FTP 21
SSH 22
TELNET 23
SMTP 25
DNS 53
BOOTP SERVER 67
BOOTP CLIENT 68
TFTP 69
FINGER 79
HTTP* 80
POP3 110
NTP 123
SNMP 161
3/25/2021 Luminiţa Scripcariu 53
PORT NUMBERS
• Protocol (Logical, Application) ports usually have unique
numbers in the Internet being supervised by IANA.
• The same port numbers are used by any transport
protocol (TCP, UDP, SCTP).
• Public applications and Internet-suite protocols have
reserved port numbers less than 255.
• Port numbers between 256 and 1023 are reserved for
applications developed by companies.
• Some port numbers (>1024) are unofficially reserved for
different producers.
• Port numbers greater than 49152 can be allocated
dynamically, for ephemeral ports.
3/25/2021 Luminiţa Scripcariu 54
3/25/2021 Luminiţa Scripcariu 55
Control Flags
• URG (Urgent) - indicates the existence of some
urgent data in the segment.
• ACK (Acknowledge) - confirms the correct delivery of
a sequence.
• PSH (Push) – forces the receiver to send data
immediately.
• RST (Reset) – resets the connection.
• SYN (Synchronize) – requests the opening of a
connection and demands the receiver to synchronize it
with the sender.
• FIN (Final) – requests the closer of the connection and
ends the transmission.
3/25/2021 Luminiţa Scripcariu 56
Three-Way Handshake Open
Connection

3/25/2021 Luminiţa Scripcariu 57


Two-Way Close Connection

• The TCP connection is closed in two


ways, by setting the FIN flag to ‘1’ by
both hosts.

3/25/2021 Luminiţa Scripcariu 58


SCTP

SCTP Packet
en.wikipedia.org.

3/25/2021 Luminiţa Scripcariu 59


Transport protocol comparison
• TCP – reliable protocol, connection-oriented,
that reassembles the sequences into one
message in the receiver (stream-oriented)
• UDP – unreliable, fast, message-oriented
protocol.
• SCTP – reliable, fast, message-oriented
protocol, including security services, ideal for
real time applications and multicast
transmissions.
3/25/2021 Luminiţa Scripcariu 60
PROPOSED EXERCISE
Subnets are defined in 193.210.30.0 network
using 255.255.255.240 subnet mask. Calculate
the following requests:
• How many bits are used to identify a subnet?
• How many bits identify the host?
• How many host addresses can be allocated?
• The address of S#1.
• The host address space in S#1.
• The broadcast address of S#1.

3/25/2021 Luminiţa Scripcariu 61

You might also like