### IPv4Part1

```IPv4 and Subnetting
Part 1
Announcements and Outline
IPv4
• Review of packet formats and addressing
•
•
Public vs. Private
Dotted decimal notation
2
IP Packet Formats
IPv4 Header: 192 bits (24 bytes)
IPv6 Header: 320 bits (40 bytes)
5-3
 Total of 4 billion possible addresses
 IP addresses often assigned in (large) groups
• Giving out many numbers at a time
•  IPv4 address space has been used up quickly
 3.2 x 1038 addresses, 320 undecillion
 Little chance this address space will ever be used up
5-4
Application Layer
Transport Layer
Network Layer
5-5
5-6
 The dotted decimal structure of a binary IP address and
label its parts
Cisco Public
7
 The general role of 8-bit binary in network addressing
and convert 8-bit binary to decimal
6.1.1.1
Cisco Public
8
 Strings of 32 binary bits
Dotted decimal notation
 Used to make IP addresses easier to understand for human
 Breaks the address into four bytes and writes the digital
equivalent for each byte
Example: 128.192.56.1
10000000 11000000 0011100000000001
5-9
Examples
11000000 10101000 00000001 00000101
192 .
168 .
1
5
10
Binary and Decimal Conversion
5 - 11
Converting from binary to decimal
• Use the same template as before
• Add the place values corresponding to the
locations that have 1 in the number
• E.g.: 11100011
128
(2^7)
64
(2^6)
32
(2^5)
16
(2^4)
8
(2^3)
4
(2^2)
2
(2^1)
In decimal, this number is:
12
1
(2^0)
Converting from binary to decimal
You should be comfortable working with binary numbers
with up to 8 bits
 e.g.: 10011011
128
64
32
16
8
4
2
1
• This number is equal to:
• Largest possible number with 8 digits?
13
Converting from binary to decimal
Try converting the following numbers to decimal
 10000110
128
64
32
16
8
4
2
1
32
16
8
4
2
1
 11001000
 11110000
128
64
14
IPv4 – Binary to Dotted Decimal Notation
5 - 15
Converting from decimal to binary
– You should be comfortable with binary numbers with up to 8
digits
• One technique is to fill-in-the-blanks
– Place 1 in the leftmost-possible position
– Subtract place-value and repeat until subtraction yields 0
128
64
32
16
8
4
2
1
16
Converting from decimal to binary
e.g.: 133
128
128
64
64
32
32
16
16
8
8
4
4
2
1
2
1
17
Converting from decimal to binary
Try converting the following numbers to binary
 134
 200
 240
18
• IP addresses are not assigned at random like MAC
– Or even on first-come-first-serve basis
• The first few address bits define the organization to
– Remaining bits are unique to the computer (host) within the
organization
19
Assigning Addresses - Network Classes (IPv4)
5 - 20
Class A networks
21
Class B and C networks
Class B networks
Class C networks
22
The use of these addresses need not be unique among outside networks.
Hosts that do not require access to the Internet at large may make
• 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8)
• 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12)
• 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16)
Does UNCW use the private address blocks within their
network?
5 - 23
Introducing NAT
and PAT
 NAT is designed to conserve IP addresses and enable networks to use
private IP addresses on internal networks.
 These private, internal addresses are translated to routable, public