Title: TCP/IP Subnetting
1(No Transcript)
2By Joshua Newell
3Protocols and Protocol Binding
- p. 159-162
- Show Activity 6-1
- Show adding protocols
4TCP/IP Subnetting (continued..)
5Review
6IP Addresses
- Every IP Address has a node portion and a
network portion
- IP Address 192.168.5.201
- Network Portion 192.168.5.201
- Node Portion 192.168.5.201
7Subnet 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
8Subnet Mask and ANDing
- IP 192.168.5.201
- Subnet 255.255.255.0
IP 11000000.10101000.00000101.11001001 Subnet 1
1111111.11111111.11111111.00000000 ---------------
-------------------------------- 11000000.101010
00.00000101.00000000
IP 11000000.10101000.00000101.11001001 Subnet 1
1111111.11111111.11111111.00000000 ---------------
-------------------------------- 11000000.101010
00.00000101.00000000
AND
9TCP/IP Cheat Sheet The Rules
- The Subnet/network address is always hidden
behind the 1s in the mask
IP 11000000.10101000.00000101.11001001 Subnet 1
1111111.11111111.11111111.00000000 ---------------
-------------------------------- 11000000.101010
00.00000101.00000000
10TCP/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 host address
Network ID 192.168.1.0 Subnet Mask
255.255.255.128 -gt 11111111.11111111.11111111.1000
0000
192.168.1.250 .11111010
-------------- 10000000
192.168.1.5 .00000101
-------------- 00000000
These bits belong to the Big IP in the Sky (we
cant change them)
These are the bits that we own
1s hide the subnet address
Breaks the rule! (except in CIDR)
11TCP/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
12Reason 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
- The all ones host address is reserved for the
broadcast address
13Classful Networking - lt1993
How do we get this?
14Classful Networking - lt1993
15Reserved IP Ranges
16NAT
17CIDR (Classless Inter-Domain Routing) - gt1993
- 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.
18My 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?
- Were only going to need to look at the last
octet - 255.255.255.0
- Remember that the subnet mask cant have embedded
1s - So, we need to know what mask to use in the 4th
octet
19Lets Look at the Cheat Sheet
So we could use a network with a subnet mask of
255.255.255.248
20CIDR Notation
of 1s in the mask
A network with a 255.255.255.248 subnet mask is
called a /29
21Using Subnetting to Segment a Network
- Suppose we lease 219.123.113 /24
- (1 network, 254 hosts using 8 host bits)
- We need to borrow some of our host bits and use
them for network bits. - IP 219.123.113.0000 0000
- Mask 255.255.255.0000 0000
22Ex. Use the /27 Mask
- IP 219.123.113.0 (0000 0000)
- Mask 255.255.255.224 (1110 0000)
Last Address
Whats the block size? 32
Block Size/ People Number
Computer Number
Last Address minus Block Size
031 3263 6495 96127 128159 160191
192223 224255
Network ID for the 0 subnet
Network ID for the 1 subnet
Network ID for the 7 subnet
23Why is it called the 0 subnet?
- Ex. The /27 mask borrows 3 host bits and makes
them network bits - .0 0000 0000
- .224 1110 0000
- Looking at the 3 borrowed bits
24Subnetting Exercise
- Youve been hired to troubleshoot a problem
network. The customer says that they are having
problems with computers being able to connect to
each other. - The network has computers with the following IPs
- 201.54.13.1
- 201.54.13.6
- 201.54.13.21
- 201.54.13.31
- 201.54.13.32
- 201.54.13.63
- 201.54.13.65
- All the computers are using the 255.255.255.224
mask - Which computers are able to communicate?
25Sample Problem
- Select the correct base network ID for
203.121.45.27 /29 - We could enumerate the /29 segments but that
would take a while. - Instead, convert the IP to binary, but only the
relevant octets. - 27d -gt binary 0001 1011
- Look at the cheatsheet to get the subnet mask for
/29 - 255.255.255.248 -gt 1111 1000
- AND the IP and the mask
- 0001 1011
- AND 1111 1000
- ---------------------------------
- 0001 1000b-gt 24d
- So, the base network ID is 203.121.45.24
26Exercise
- Select the correct base network ID for
203.121.45.31 /30
IP 203.121. 45 . 0001 1111 Mask 255.255.255.
1111 1100 ----------------------------------------
--------- AND 203.121. 45 . 0001 1100
28 203.121.45.28
27Subnetting Exercise 2
- Write out the subnets for the 202.54.13.0
network, subnetted with the 255.255.255.240 mask. - Whats the network address of the 0 subnet?
- Whats the first host address in the 0 subnet?
- Whats the last host address in the 2 subnet?
- Whats the broadcast address for the 3 subnet?
28TCP/IP Network Model
29ARP
Hey everybody! Who is 192.168.5.104?
Thanks! Ill remember that for next time.
Not me
Not me
Not me
Hey 192.168.5.101! I am. My MAC is
0011223344ABCDEF
30Ports and Sockets
I want to see whats new on www.yahoo.com
Hey operating system, send an http get request to
www.yahoo.com on Port 80
I provide http services on port 80
I provide ftp services on port 20
31Ok! But first I need to create a port for you so
I can keep track of everything.
I also need to get www.yahoo.coms IP address.
OK, got it from DNS
Dear tcp, 87.248.113.14, 80, Please send me
your webpage. My address is 68.15.123.1449152
I got a message from www.yahoo.com. Its
addressed on port 49152. Thats for Internet
Explorer. Hey IE, heres your page.
Thanks!
TCP 49152 - OPEN
Dear tcp, 68.15.123.14, 49152, I got your
message. The webpage is as follows.
32DHCP Lease Process
DHCP Discover (Broadcast)
DHCP Offer (Broadcast)
DHCP Request (Broadcast)
DHCP Acknowledgment (Broadcast)
33DHCP Relay Agent
- Routers do not forward broadcast traffic
- (Does everyone in the world need to hear your LAN
ARP requests?)
34DHCP Relay Process
DHCP Discover (Broadcast)
DHCP Offer (Broadcast)
DHCP Request (Broadcast)
DHCP Acknowledgment (Broadcast)
DHCP Discover, DHCP Offer, DHCP Request, DHCP
Acknowledgment (All done in Unicast)
35DNS
- FQDN Fully qualified domain name
- www.google.com.
- .(dot) Root
- com Top Level Domain (TLD)
- Google Second-level domain
- www Alias or Host Name
36DNS