Documente Academic
Documente Profesional
Documente Cultură
IP Address: 192.168.5.201
Network Portion: 192.168.5.201
Node Portion: 192.168.5.201
Subnet Mask
•The subnet mask tells us which part of an IP address
is the node portion vs. the network portion
•An IP address without a subnet mask is meaningless
IP Address: 192.168.5.201
Subnet Mask: 255.255.255.0
----------------------------------------------------
Network ID: 192.168.5.0
Subnet Mask and ANDing
• IP: 192.168.5.201
• Subnet: 255.255.255.0
IP: 11000000.10101000.00000101.11001001
Subnet: 11111111.11111111.11111111.00000000
-----------------------------------------------
AND 11000000.10101000.00000101.00000000
TCP/IP Cheat Sheet: The Rules
• The Subnet/network address is always
hidden behind the 1s in the mask
IP: 11000000.10101000.00000101.11001001
Subnet: 11111111.11111111.11111111.00000000
-----------------------------------------------
11000000.10101000.00000101.00000000
TCP/IP Cheat Sheet: The Rules
(Except in special cases)
• The all-1s and all-0s subnet addresses
are invalid (but NOT in CIDR)
Ex.
0s hide the
Network ID 192.168.1.0 host
Subnet Mask 255.255.255.128 -> address
11111111.11111111.11111111.10000000
These bits belong to 192.168.1.250=
192.168.1.5= .00000101
.11111010
the Big IP in the Sky
(we can’t change
--------------
--------------
These are
the bits
them) 1s hide the 00000000
10000000
that we
Breaks the rule!
subnet(except
address in CIDR )
own
TCP/IP Cheat Sheet: The Rules
(Except in special cases)
• The all-1s and all-0s host addresses are
invalid (Always)
Ex.
IP Address: 192.168.1.0
Subnet Mask: 255.255.255.0
OR
IP Address: 192.168.1.255
Subnet Mask: 255.255.255.0
Reason Behind the Rule
• The all zeros host address is the same as
the network ID
Ex. IP: 192.168.1.0
Subnet: 255.255.255.0
----------------------------------------
Network ID: 192.168.1.0
D Multicast
E Experimental/ How do we
get this?
Reserved
Classful Networking - <1993
Class Leading Start End
Bits
A 0 0.0.0.0 127.255.255.255
B 10 128.0.0.0 191.255.255.255
192.168.5.101
192.168.5.1
`
68.25.13.107
192.168.5.102
Internet
192.168.5.103
192.168.5.104
CIDR (Classless Inter-Domain
Routing) - ~>1993
• Specifically, rather than allocating address
blocks on eight-bit (i.e., octet) boundaries
forcing 8, 16, or 24-bit prefixes, it used the
technique of variable-length subnet
masking (VLSM) to allow allocation on
arbitrary-length prefixes.
My company needs 4 IPs
• With classful subnetting, I would need a Class C (default subnet mask
255.255.255.0) with 254 IPs What a waste!
• How would we use CIDR?
– We’re only going to need to look at the last octet
• 255.255.255.0
• Remember that the subnet mask can’t have embedded 1s
• So, we need to know what mask to use in the 4th octet
Let’s Look at the Cheat Sheet
Bits Mask Blocks Nets Hosts
0000 0000 0 256 1 254
1000 0000 128 128 2 126
1100 0000 192 64 2* 62
1110 0000 224 32 6 30
1111 0000 240 16 14 14
1111 1000 248 8 30 6
1111 1100 252 4 62 2
1111 1110 254 2 126 X
1111 1111 255 1 254 X
So we could use a network with a subnet mask of 255.255.255.248
# of 1s in
the mask CIDR Notation
CIDR
Notation Bits Mask Blocks Nets Hosts
/24 0000 0000 0 256 1 254
/25 1000 0000 128 128 2 126
/26 1100 0000 192 64 2* 62
/27 1110 0000 224 32 6 30
/28 1111 0000 240 16 14 14
/29 1111 1000 248 8 30 6
/30 1111 1100 252 4 62 2
/31 1111 1110 254 2 126 X
/32 1111 1111 255 1 254 X
203.121.45.28
Subnetting Exercise 2:
Write out the subnets for the 202.54.13.0
network, subnetted with the
255.255.255.240 mask.
192.168.5.101
Not me… Not me…
Not me…
`
192.168.5.102 192.168.5.1
68.25.13.107 Internet
192.168.5.103
68.15.123.14
I provide http
services on
port 80
Internet
I provide ftp
services on
port 20
ftp.microsoft.com
www.yahoo.com
Ok! But first I need to create a port
for you
I also sotoI can
need keep track of
get www.yahoo.com’s
Dear {tcp, 87.248.113.14,
everything. 80},
IP address…. OK, got it from DNS
Please send me your webpage. My
address is: 68.15.123.14:49152
Internet
Dear {tcp, 68.15.123.14, 49152},
I got your message. The webpage is
as follows:….
ftp.microsoft.com
www.yahoo.com
DHCP Lease Process
192.168.5.101
DHCP
192.168.5.1 `
`
192.168.6.1 192.168.6.102
192.168.5.102
192.168.5.0 192.168.6.0
192.168.6.103
192.168.5.103
192.168.6.104
192.168.5.104
DHCP Relay Process
DHCP Discover (Broadcast)
` DHCP Relay Agent
DHCP Offer (Broadcast)
DHCP Server
DNS
• FQDN – Fully qualified domain name
www.google.com.
– .(dot) = Root
– com = Top Level Domain (TLD)
– Google = Second-level domain
– www = Alias or Host Name
DNS