network layer –2 addressing, nat, icmp

12
Network Layer – 2 Addressing, Subnetting Shri Mare [email protected] CSCI 367: Computer Networks I Thanks to Aran Clauson, Dustin O'Hara, Michael Meehan, Michael Tsikerdekis, Ratul Mahajan, Brian Hutchinson, and many others for sample slides and materials ...

Upload: others

Post on 01-Jan-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Network Layer –2 Addressing, NAT, ICMP

Network Layer – 2Addressing, Subnetting

Shri [email protected]

CSCI 367: Computer Networks I

Thanks to Aran Clauson, Dustin O'Hara, Michael Meehan, Michael Tsikerdekis, Ratul Mahajan, Brian Hutchinson, and many others for sample slides and materials ...

Page 2: Network Layer –2 Addressing, NAT, ICMP

Addressing Scheme• Addresses should be globally unique and should

have hierarchy.• Original addressing scheme had 3 classes, and

hence called classful addressing: Classes A, B, and C• IP address has two parts: network address and host

address.• Network address: IP address with host part as 0s.

• E.g., for class C IP address 172.16.13.42, network address is 172.16.13.0

• Nodes in the same network should have the same network address.

• Problem with classful addressing:• Address allocation is inefficient• Not enough addresses for all the devices on the

Internet!• A partial solution: subnetting

REVIEW

Page 3: Network Layer –2 Addressing, NAT, ICMP

REVIEW

Subnetting

Page 4: Network Layer –2 Addressing, NAT, ICMP

Subnet Mask Representation & Slash Notation• Subnet masks are commonly represented using

dotted decimal representation.• To make it easier to understand and represent

address masks, the IETF developed syntactic form that is informally known as Slash notation.

• For example• Dotted decimal: 255.255.255.0 • Slash notation: /24

Page 5: Network Layer –2 Addressing, NAT, ICMP

Classless Addressing Scheme• Classless addressing does away with the class A, B,

and C addresses. In place of the three classes, the new scheme extends the ideas used in subnetting.

• The technology became known as Classless Inter-Domain Routing (CIDR).• Class A, B, and C, did not divide network addresses into

equal size classes. While there were fewer than seventeen thousand B class numbers created, there were more than two million C class network numbers created.

• Because C prefixes only suffice for small networks and are not amenable to subnetting, demand for C prefixes was lower

• Demand for class B prefixes address would exhaust supply

• So one of the first uses of classless addressing was known as supernetting, and would enable an organization to receive a contiguous set of class C addresses instead of a class B address.

• Natural extension of the subnet idea but to the entire IP address space.

Page 6: Network Layer –2 Addressing, NAT, ICMP

IPv4 Address Blocks and CIDR Slash Notation• Dotted decimal 32-bit Binary Equivalent

• Lowest 128.211.168.0 10000000 11010011 10101000 00000000• Highest 128.211.175.255 10000000 11010011 10101111 11111111

• Slash or CIDR notation: 128.211.168.0/21

/21 defines a network with 2046 hosts (2048 IP addresses)

Page 7: Network Layer –2 Addressing, NAT, ICMP

IPv4 Address Blocks and CIDR Slash Notation• Dotted decimal 32-bit Binary Equivalent

• Lowest 128.211.176.212 10000000 11010011 10110000 11010100• Highest 128.211.176.215 10000000 11010011 10110000 11010111

• Slash or CIDR notation: 128.211.176.212/30

/30 defines a network with 2 hosts (4 IP addresses)

Page 8: Network Layer –2 Addressing, NAT, ICMP

In-class Activity: L16 Worksheet 1• 5 min: Attempt Canvas quiz L16 Worksheet 1 by yourself

• 5 min: Join your group and discuss the quiz questions.

• Regroup in #class

Page 9: Network Layer –2 Addressing, NAT, ICMP

In-class activityQ1) For the IP address in slash notation 172.16.23.45/24, what is the

• Network address (in the form ww.xx.yy.zz):• Network mask (in the form ww.xx.yy.zz):

Q2) For the IP address in slash notation 172.16.23.45/25, what is the• Network address (in the form ww.xx.yy.zz):• Network mask (in the form ww.xx.yy.zz):

Page 10: Network Layer –2 Addressing, NAT, ICMP

In-class activityQ3) A large number of consecutive IP addresses are available starting at 172.24.0.0. Suppose that an organization A requests 4096 addresses. Give the first IP address assigned, the last IP address assigned, and the network bit mask number.

• First IP address:• Last IP address:• Mask number:

• Network address:

Page 11: Network Layer –2 Addressing, NAT, ICMP

IPv4 CIDR Blocks Reserved for Private Networks• In the context of a private intranet, that does not connect with the larger internet,

arbitrary addresses could be used. To avoid conflict between private and public addresses, the IETF reserved several address prefixes for private intranets. • Private addresses or non-routable address• If packets containing one of the private addresses is forwarded to the global internet, a

router will detect the problem and discard the packet.

Prefix Lowest address Highest address

10.0.0.0/8 10.0.0.0 10.255.255.255

172.16.0.0/12 172.16.0.0 172.31.255.255

192.168.0.0/16 192.168.0.0 192.168.255.255

169.254.0.0/16 169.254.0.0 169.254.255.255

Page 12: Network Layer –2 Addressing, NAT, ICMP

IPv4 Special Addresses• Network Address: an address that has a Host ID of 0, is used to refer to the network itself. • Network Broadcast Address: all 1s in the Host ID of a destination address, it refers to all computers on a specific network. • Subnet Broadcast Address: using a subnet prefix of all 1s, the subnet broadcast address is used on a single network

within a site that used subnetting. • Multicast Addresses: In addition to unicast and broadcast delivery, IPv4 support multicasting (a topic we will examine in

more detail later). • Loopback Address: using the network prefix 127.0.0.0/8 (a value originally from class A range) is reserved for loopback

and intended for use in testing TCP/IP and for inter-process communication on the local computer. • All-1s: used to broadcast across local network and used at startup before a computer learns its IP address. • All-0s: Source Address: when a host need to communicate but does not know its address yet.