networking chapter 7
TRANSCRIPT
![Page 1: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/1.jpg)
TCP/IP Basics
Chapter 7
![Page 2: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/2.jpg)
ObjectivesObjectives• Describe how the Internet Protocol works• Explain CIDR and subnetting• Describe the functions of static and dynamic
IP addresses
![Page 3: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/3.jpg)
OverviewOverview
![Page 4: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/4.jpg)
Moving up the OSI LayersMoving up the OSI Layers
• Chapters 3 through 6 detailed Layers 1 and 2• Ethernet network technology• Now explore the software side of networking
– Individual rule is a protocol– A protocol suite is a set of rules
• Begin with Internet Protocol (IP) of TCP/IP
![Page 5: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/5.jpg)
Three Parts to Chapter 7Three Parts to Chapter 7
• IP in Depth• CIDR and Subnetting• Using IP Addresses
![Page 6: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/6.jpg)
IP in DepthIP in Depth
![Page 7: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/7.jpg)
IP in DepthIP in Depth• TCP/IP suite supports both simple and
complex networks– Small LAN– Multiple LANs interconnected into a WAN
![Page 8: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/8.jpg)
• TCP/IP on LAN over Ethernet– On small network, sending computer broadcasts
using MAC address ff-ff-ff-ff-ff-ff to obtain recipient’s MAC address
– Broadcasting is disastrous to a large network
![Page 9: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/9.jpg)
Figure 7.2 PC broadcasting for a MAC address
![Page 10: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/10.jpg)
Figure 7.3 Broadcasting won’t work for the entire Internet
![Page 11: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/11.jpg)
• TCP/IP on LAN over Ethernet– IP addressing overcomes limits of Ethernet MAC
addresses• Unique IP address per host• Unique address per logical network• Communicate between LANs without broadcasts
![Page 12: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/12.jpg)
• IP Addresses (IPv4 only]– 32-bit value
• Example: 11000000101010000000010000000010• Broken into four groups of eight
11000000.10101000.00000100.00000010• Each 8-bit value convertsed into a decimal number
between 0 and 255
![Page 13: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/13.jpg)
• Binary to Decimal Conversion
Binary Decimal
00000000 0
00000001 1
00000010 2
00000011 3
00000100 4
00000101 5
00000110 6
00000111 7
00001000 8
skip a bunch skip a bunch
Binary Decimal
11111000 248
11111001 249
11111010 250
11111011 251
11111100 252
11111101 253
11111110 254
11111111 255
![Page 14: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/14.jpg)
• IP Addresses (IPv4 only]– Converted:
11000000101010000000010000000010is displayed as 192.168.4.2 in dotted decimal notation (dotted-octet numbering system)
– Know how to convert dotted decimal to binary and back
• Every OS has a calculator
![Page 15: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/15.jpg)
• Using a Calculator for conversion– Decimal to binary
• Enter value in decimal view• Switch to binary view to convert value• Leading zeroes do not display in Calculator• Leading zeroes important when working with IP
addresses
![Page 16: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/16.jpg)
Figure 7.4 Macintosh OS X Calculator in Programmer mode
![Page 17: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/17.jpg)
Figure 7.5 Converting decimal to binary with Windows Vista’s Calculator
![Page 18: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/18.jpg)
• Every MAC address must be unique• Every IP address must be unique
![Page 19: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/19.jpg)
Figure 7.6 Small network with both IP and MAC addresses
![Page 20: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/20.jpg)
• Utilities for displaying IP and MAC addresses– Every OS has at least one GUI tool
• Mac OS X system’s Network utility• Windows Local Area Connection Properties
– Every OS has a command-line utility• Windows has IPCONFIG• UNIX/Linux/Mac use IFCONFIG
![Page 21: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/21.jpg)
Figure 7.7 Macintosh OS X Network utility
![Page 22: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/22.jpg)
Figure 7.8 ipconfig/all
![Page 23: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/23.jpg)
Figure 7.9 IFCONFIG in Ubuntu
![Page 24: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/24.jpg)
• IP Addresses in Action– IP must do three things
1. Give each LAN its own identifier2. Allow routers connecting LANs to use network
identifiers to send packets to the right network3. Give each computer a way to understand when a
packet is intended for a computer on the local LAN or for a computer on the WAN
![Page 25: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/25.jpg)
1. IP must give each LAN its own identifier– Network IDs
• All computers on same LAN must have same network ID• Each computer on same LAN must have a unique host ID• Example: 192.168.5.x represents addresses in Figure 7.10
– Network address of this network is 192.168.5.0 (assuming a 24-bit mask)
– Network ID plus Host ID = one IP address.
![Page 26: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/26.jpg)
Figure 7.10 IP addresses for a LAN
![Page 27: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/27.jpg)
2. IP must allow routers connecting LANs to use network identifiers to send packets to the right network– Interconnecting
• Requires a router connection• Router requires a network connection and IP
address on each LAN– IP address of router’s connection to a LAN is the
default gateway for that LAN– Network administrators often give lowest host
address in the network to the router
![Page 28: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/28.jpg)
Figure 7.11 LAN with router
![Page 29: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/29.jpg)
– Interconnecting (cont.)• Router uses a built-in router table
– Uses this to determine where to send packets– How router uses routing table:
Everything for 192.168.5.0 goes out 192.168.5.1
Everything else goes out 14.23.54.223
![Page 30: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/30.jpg)
Figure 7.12 Router diagram
![Page 31: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/31.jpg)
Figure 7.13 LAN, router, and the Internet
![Page 32: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/32.jpg)
– Interconnecting (cont.)• Limitations of using 192.168.5.0 as host ID
– Limited to 192.168.5.1 through 192.168.5.254(254 addresses)
• Network ID of 170.45.0.0 has a total of 65,534 hosts• Network ID of 12.0.0.0 has a total of 16.7 million hosts• Network IDs allow router to connect multiple LANs to a
WAN
![Page 33: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/33.jpg)
3. IP must give each computer a way to understand when a packet destination is local or on the WAN– Subnet Mask
• Sending to host on same network: broadcast for MAC address• Sending to host on another network: send to default gateway• Sending computer uses subnet mask to determine where to send
packet• Example of a subnet mask using dotted-octet binary notation:
11111111.11111111.11111111.00000000• Example of the same subnet mask using dotted decimal notation:
255.255.255.0
![Page 34: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/34.jpg)
Figure 7.14 The three amigos, separated by walls or miles
![Page 35: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/35.jpg)
Figure 7.15 Sending a packet remotely
![Page 36: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/36.jpg)
– Subnet Mask (cont.)• Line up an IP address with a corresponding subnet mask
in binary– Portion of IP address that aligns with the ones of the
subnet mask is the network ID of the IP address.– Portion of IP address that aligns with the zeroes of the
subnet mask is the HostID of the IP address
![Page 37: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/37.jpg)
Dotted BinaryDecimal
IP address 192.168.5.23 11000000.10101000.00000101.00010111Subnet mask 255.255.255.0 11111111.11111111.11111111.00000000Network ID 192.168.5.0 11000000.10101000.00000101.xHost ID x.x.x.23 x.x.x.00010111
![Page 38: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/38.jpg)
– Subnet Mask (cont.)• Sending computer compares the destination IP address
to its own IP address using the subnet mask• If the destination IP address matches the computer IP
wherever there’s a 1 in the subnet mask, sending computer knows the address is local
• If the destination IP address does not match the sending computer’s IP wherever there’s a 1 in the subnet mask, sending computer knows the address is remote
![Page 39: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/39.jpg)
Figure 7.16 Comparing addresses
![Page 40: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/40.jpg)
– Subnet Mask (cont.)• When the destination address is local, the sending
computer sends out an Address Resolution Protocol (ARP) broadcast to determine the destination computer’s MAC address
• The ARP packet contains the sending computer’s IP address as well as the destination address
• Destination computer responds to the ARP request by sending an ARP response containing its MAC address
• Sending computer can now send data packets to destination
![Page 41: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/41.jpg)
Figure 7.17 Sending an ARP
![Page 42: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/42.jpg)
Figure 7.19 Computer B responds
![Page 43: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/43.jpg)
– Subnet Mask (cont.)• When the sending computer discovers that the
destination address does not have the same network ID as itself, then it must send the packet beyond the local network
• The packet must be sent to the default gateway• Sending computer must ARP for the MAC address of the
default gateway
![Page 44: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/44.jpg)
Figure 7.20 Comparing addresses again
![Page 45: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/45.jpg)
Figure 7.21 Sending an ARP to the gateway
![Page 46: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/46.jpg)
11111111111111111111111100000000 = 255.255.255.011111111111111110000000000000000 = 255.255.0.011111111000000000000000000000000 = 255.0.0.0
11111111111111111111111100000000 = /24 (24 ones)11111111111111110000000000000000 = /16 (16 ones)11111111000000000000000000000000 = /8 (8 ones)
– Subnet Mask (cont.)• Some valid subnet masks
• Shorthand for subnet mask
![Page 47: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/47.jpg)
201.23.45.123/24 = IP address plus subnet maskIP address = 201.23.45.123Subnet mask = 255.255.255.0
– Subnet Mask (cont.)• An IP address followed by the / and a
number describes the IP and the address in one statement
184.222.4.36/16 = IP address plus subnet maskIP address = 184.222.4.36Subnet mask = 255.255.0.0
![Page 48: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/48.jpg)
– Subnet Mask (cont.)• Network administrators must enter correct IP address
and subnet mask when configuring a network card• The networking software does the rest• If you want a computer to work in a routed network,
you must configure the computer correctly with an IP address, subnet mask, and default gateway
![Page 49: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/49.jpg)
– Class IDs• No two devices on the Internet can share the same IP
address• Internet Assigned Number Authority (IANA) tracks and
disperses IP addresses in chunks called class licenses– Oversees several Regional Internet Registries (RIRs)– RIRs in turn pass out IP addresses to large ISPs– ISPs pass out IP addresses to most end users
![Page 50: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/50.jpg)
Class A 1 – 126 1.0.0.0 – 126.255.255.255 16,277,214
Class B 128 – 191 128.0.0.0 – 191.255.255.255 65,534
Class C 192 – 223 192.0.0.0 – 223.255.255.255 254
Class D 224 – 239 224.0.0.0 – 239.255.255.255 Multicast
Class E 240 – 255 240.0.0.0 – 255.255.255.255 Reserved
First Decimal Value (range) Addresses
Hosts perNetwork ID
IP Address Classes
![Page 51: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/51.jpg)
– Class IDs – More about Class D and E• Three ways to send a packet
– Broadcast to every computer on the LAN– Unicast from one computer to another computer– Multicast from one computer to a group
» Uncommon between computers» Often used by routers
![Page 52: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/52.jpg)
– Class IDs – The state of IP address• IP class licenses were allocated too generously at first• Unallocated IP addresses became scarce• IP class licenses concept did not scale well
– If you needed 2000 IP addresses you had to take a single Class B or eight Class C licenses
• Solution– New method for generating blocks of IP addresses– Classless Inter-Domain Routing (CIDR)
![Page 53: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/53.jpg)
CIDR and SubnettingCIDR and Subnetting
![Page 54: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/54.jpg)
• CIDR and Subnetting Overview– CIDR based on subnetting– Subnetting chops up a single class of IP addresses
into multiple smaller groups– CIDR and subnetting are virtually the same thing– Subnetting done by an organization on a block of
addresses to create multiple subnetworks– CIDR done by an ISP on a block of addresses to
create multiple subnets to pass out to customers
![Page 55: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/55.jpg)
• Subnetting– More efficient use of IP addresses than class
licenses– Enables separation of networks for security– Enables bandwidth control– Subnet mask is cornerstone of subnetting
• Extend subnet masks of /8, /16, or /24 subnet by adding more ones (removing equal number of zeroes).
![Page 56: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/56.jpg)
• Subnetting the Internet Café– 50 computers
• 40 public computers• 10 back office computers• 10 wireless clients (maximum)
– Network ID 192.168.4/24– Must prevent people using the public system from
accessing private machines
![Page 57: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/57.jpg)
Figure 7.22 Layout of the network
![Page 58: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/58.jpg)
• Subnetting the Internet Café (cont.)– Begin with the given subnet mask and move it to
the right until you have the number of subnets you need
– Forget the dots• Don’t be limited to /8, /16, /24 networks• Network IDs do not need to end on the dots• Create subnets of /26, /27, /22, etc.
![Page 59: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/59.jpg)
• Subnetting the Internet Café (cont.)– 192.168.4/24– Change a zero to a one in the subnet mask– /24 becomes a /25 subnet
11111111111111111111111110000000
![Page 60: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/60.jpg)
• Calculating Hosts– Hosts on a /24 network– 192.168.4.1 to 192.168.4.254 = 254 hosts– Calculate in binary
• In a /24 network 8 binary digits are used for the host ID• 00000001 to 11111110 = 254 hosts• 2(number of zeroes in the subnet mask) – 2• 28 – 2 = 254 total hosts
– Memorize the formula
![Page 61: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/61.jpg)
• Calculating Hosts (cont.)– Hosts on a /16 network
• In a /16 network 16 zeroes are part of the host ID• 0000000000000001 to 1111111111111110 = 65,534
hosts• 2(number of zeroes in the subnet mask) – 2• 216 – 2 = 65,534 total hosts
![Page 62: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/62.jpg)
• Calculating Hosts (cont.)– Hosts on a /26 network
• In a /26 network 6 zeroes are part of the host ID• 000001 to 111110 = 62 hosts• 2(number of zeroes in the subnet mask) – 2• 26 – 2 = 62 total hosts
![Page 63: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/63.jpg)
• Your First Subnet– Convert the 192.168.4/24 net ID into three
network IDs– Write out the subnet mask in binary– Place a line at the end of the ones
![Page 64: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/64.jpg)
Figure 7.23 Step 1 in subnetting
![Page 65: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/65.jpg)
• Your First Subnet (cont.)– Draw a second line one digit to the right– Three areas (a Mike Trick, not official terms)
• Subnet mask (SM)• Network ID extension (NE)• Hosts (H)
– This is now a /25 subnet mask
![Page 66: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/66.jpg)
Figure 7.24 Organizing the subnet mask
![Page 67: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/67.jpg)
• Your First Subnet (cont.)– A subnet mask is always 32 binary digits long– A string of ones followed by a string of zeroes11111111111111111111111110000000
– Put periods between every eight digits11111111.11111111.11111111.10000000
– Then convert to dotted decimal– The resulting subnet mask:
255.255.255.128
![Page 68: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/68.jpg)
• Your First Subnet (cont.)– Get used to the idea of subnet masks that use
more than 255s and 0s (in dotted decimal form)– Examples of legitimate subnet masks
•255.255.255.22411111111.11111111.11111111.11100000
•255.255.128.011111111.11111111.10000000.00000000
•255.248.0.011111111.11111000.00000000.00000000
![Page 69: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/69.jpg)
• Rules for Calculating Subnets1. Starting with a beginning subnet mask, you
extend the subnet extension until you have the number of subnets you need
2. You cannot have an NE of all zeroes or all ones, so you calculate the number of subnets using this formula: new subnets = 2(number of zeroes in the subnet mask) – 2
3. You cannot have a single-character network ID extension. You always start by moving the subnet at least two digits
![Page 70: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/70.jpg)
• Calculating Subnets (cont.)– Rules 2 and 3 explained
• Adding just a single digit to the beginning subnet mask only gives you two network IDs: a zero and a one
• You cannot have a network ID extension of all zeroes or all ones
• Therefore, you need rule 3
![Page 71: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/71.jpg)
Figure 7.25 Organizing the subnet mask
![Page 72: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/72.jpg)
Figure 7.26 Single-digit network ID extensions are not allowed
![Page 73: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/73.jpg)
• Calculating Subnets (cont.)– Subnet /24 to /26– Adds two digits, creating four new network IDs
(two of which are not usable)– Convert the original network ID to binary and
add the four different network ID extension to the end
– The possible NEs in binary are 00, 01, 10, 11– Can’t have all zeroes, can’t have all ones– Therefore, only two new networks (01 and 10)
![Page 74: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/74.jpg)
Figure 7.27 Creating the new network IDs
![Page 75: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/75.jpg)
Figure 7.28 New network ID address ranges
![Page 76: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/76.jpg)
• Calculating Subnets (cont.)– The new network IDs in decimal
192.168.4.64/26 hosts = 192.168.4.65 – 192.168.4.126
192.168.4.128/26 Hosts = 192.168.4.129 – 192.168.4.191
![Page 77: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/77.jpg)
Figure 7.29 Two networks using the two network IDs
![Page 78: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/78.jpg)
• Calculating Subnets (cont.)– The Internet Café needs three subnets– How large a network ID extension is needed?– Two NE digits = 22 – 2 = 2 network IDs– Three NE digits = 23 – 2 = 6 network IDs– Therefore, you need to extend the NE three
digits to get at least three network IDs– Three are wasted
![Page 79: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/79.jpg)
• Calculating Subnets (cont.)– Create a /27 subnet by moving the NE over three
digits– Calculate the host address ranges for each usable
new subnet– 192.168.4.32/27 (192.168.4.33–192.168.4.62)– 192.168.4.64/27 (192.168.4.65–192.168.4.94)– 192.168.4.96/27 (192.168.4.97–192.168.4.126)– 192.168.4.128/27 (192.168.4.129–192.168.4.158)– 192.168.4.160/27 (192.168.4.161–192.168.4.190)– 192.168.4.192/27 (192.168.4.193–192.168.4.222)
![Page 80: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/80.jpg)
Figure 7.30 Moving the network ID extension three digits
![Page 81: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/81.jpg)
Figure 7.31 Two of the six network ID address ranges
![Page 82: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/82.jpg)
• Manual Binary to Dotted Decimal Conversion– Write bit values in decimal from left to right– Take binary value of one dotted octet portion and
place ones and zeroes under appropriate positions128 64 32 16 8 4 2 1
1 0 0 1 0 1 1 0
– Add the decimal values that have a 1 underneath
128+16+4+2 = 150
![Page 83: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/83.jpg)
• Manual Dotted Decimal to Binary Conversion– Start with bit values beginning with 128– Place decimal value above the first value on the
left which it exceeds and subtract and place a one to represent this binary value
221
128 64 32 16 8 4 2 1
93
1
![Page 84: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/84.jpg)
• Manual Dotted Decimal to Binary Conversion– Place the remainder above the next bit value that
it exceeds (Place a zero in positions that are skipped)221 93 29 13 5 1
128 64 32 16 8 4 2 1
93 29 13 5 1 0 1 1 0 1 1 1 0 1
– Decimal 221 = binary 11011101
![Page 85: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/85.jpg)
• CIDR: Subnetting in the Real World– Two situations in which subnetting takes place
• ISPs (Large ones)– Receive class licenses from IANA– Subnet those class licenses for customers
• Very large customers– Take subnets from ISPs
(sometimes already subnetted class licenses)– Make their own subnets
![Page 86: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/86.jpg)
• CIDR: Subnetting in the Real World (cont.)– Why learn subnetting?
• CompTIA Network+ exam requires it• There’s a good chance you’ll contact an ISP and get
CIDR addresses– Think of subnets in terms of CIDR values like
/8, /22, /26, and so on• More advanced IT certifications (Cisco, Microsoft,
etc.) require this knowledge
![Page 87: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/87.jpg)
Using IP AddressesUsing IP Addresses
![Page 88: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/88.jpg)
• Overview of Using IP Addresses– Assigning IP addresses to computers– Specialty IP addresses
![Page 89: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/89.jpg)
• Assigning an IP address, subnet mask, and default gateway– Static addressing
• Type in all the information– Dynamic addressing
• Server program automatically passes out the information to computers on the network
![Page 90: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/90.jpg)
• Static IP Addresses– Manually type in all IP information
• What are you typing in?• Where do you type it?
– Assuming a Class C license for 197.156.4/24• You can do whatever you want with your own network ID• Use legit IP address and mask for network ID• Every IP address must be unique• You don’t have to use the numbers in order• You don’t have to use 197.156.4.1 as default gateway
![Page 91: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/91.jpg)
Figure 7.32 A small network
![Page 92: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/92.jpg)
• Static IP Addresses (cont.)– Network techs’ set of principles
• Give the default gateway the first host IP address in the network ID
• Try to use the IP addresses in some kind of sequential order• Try to separate servers from clients
– Servers host addresses: 197.156.4.10 to 197.156.4.19– Client host addresses: 197.156.4.200 to 197.156.4.254
• Write down whatever you do so person who comes after you understands what you did
![Page 93: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/93.jpg)
• Static IP Addresses (cont.)– Give each computer an IP address, subnet mask, and
default gateway• In Windows use the Internet Protocol Version 4 (TCP/IPv4)
Properties dialog box• In Macintosh OS X, run the Network utility in System
Preferences• In UNIX/Linux use the command-line IFCONFIG command
![Page 94: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/94.jpg)
Figure 7.33 Entering static IP information in Windows Internet Protocol Version 4 (TCP/IPv4) Properties
![Page 95: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/95.jpg)
Figure 7.34 Entering static IP information in the OS X Network utility
![Page 96: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/96.jpg)
Figure 7.35 IFCONFIG command to set static IP address
![Page 97: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/97.jpg)
Figure 7.36 Ubuntu’s Network Configuration utility
![Page 98: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/98.jpg)
• Static IP Addresses (cont.)– After adding IP information to at least two systems,
verify with the PING command– Successful PING confirms two systems can
communicate– If the PING is not successful
• Check your IP settings• Check connections, driver, etc.
– Static addressing used for most critical systems– Most systems today use dynamic IP addressing
![Page 99: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/99.jpg)
Figure 7.37 Two PINGs (successful PING on top, unsuccessful PING on bottom)
![Page 100: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/100.jpg)
• Dynamic IP Addressing– Dynamic Host Configuration Protocol (DHCP)
• More popular form of dynamic IP addressing• Bootstrap Protocol (BOOTP) older version
– Automatically assigns an IP address whenever a computer connects to the network
– DHCP uses a simple process• Computer is configured to use DHCP• Every OS has a method to tell computer to use DHCP• Windows setting: Obtain an IP address automatically
![Page 101: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/101.jpg)
Figure 7.38 Setting up for DHCP
![Page 102: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/102.jpg)
• How DHCP Works– DHCP Server is configured to pass out IP addresses
• Scope = range of IP addresses• Subnet mask for scope• Default gateway for scope• Gives out other information (detailed in later chapters)
![Page 103: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/103.jpg)
• How DHCP Works (cont.)– When DHCP client boots up it broadcasts a
DHCP discovery packet• Discovery packet asks “Are there any DHCP servers
out there?”• DHCP server responds with a DHCP offer• DHCP clients responds with a DHCP request• DHCP server responds with a DHCP acknowledge
and maintains a database of the MAC addresses of DHCP clients along with the IP information assigned to each
• DHCP client accepts with a DHCP lease
![Page 104: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/104.jpg)
Figure 7.39 Computer sending out a DHCP discovery message
![Page 105: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/105.jpg)
Figure 7.40 DHCP server sending DHCP offer
![Page 106: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/106.jpg)
Figure 7.41 DHCP request and DHCP acknowledge
![Page 107: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/107.jpg)
• How DHCP Works (cont.)– DHCP Lease
• Set for a fixed amount of time• Usually 5 to 8 days• At the end of the lease time, DHCP client makes
another DHCP discovery message• DHCP server looks at the MAC address, comparing
it to its database of leases• Unless another computer has taken the lease, server
will give the client the same IP information, including the same IP address
![Page 108: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/108.jpg)
• Living with DHCP– Possible problems
• DHCP client tries to get a DHCP address and fails• Symptoms
– OS will post an error– DHCP client will have an address in the 169.254/16
network ID– Can access local computers, but cannot connect to
Internet
![Page 109: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/109.jpg)
Figure 7.42 DHCP error in Ubuntu Linux
![Page 110: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/110.jpg)
• Living with DHCP– Automatic Private IP Addressing (APIPA)
• Addresses in the 169.254/16 network ID that a DHCP client will assign to itself when it fails to find a DHCP server
• Allows computers on same LAN to communicate (if they are using APIPA)
• APIPA does not provide default gateway, so clients using APIPA cannot access the Internet
• Use available tool to see IP settings• If you see an APIPA address, you know you have a
DHCP problem
![Page 111: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/111.jpg)
• Living with DHCP– Reestablish the lease manually– In Windows
• Ipconfig/renew– On a Macintosh
• Go to System Preferences and use the Network utility– May need to force computer to release its lease
• Windows command line: ipconfig /releaseipconfig /renew
• Release in Linux: sudo ifconfig eth0 down• Renew in Linux: sudo ifconfig eth0 up
![Page 112: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/112.jpg)
Figure 7.43 Network utility in System Preferences
![Page 113: Networking Chapter 7](https://reader035.vdocuments.mx/reader035/viewer/2022062405/555896a3d8b42a2a738b47ee/html5/thumbnails/113.jpg)
• Special IP Addresses– Loopback = 127.0.0.1
• Use to send packets from your NIC to itself• Test NIC’s capability to send and receive packets:
ping 127.0.0.1
– Private IP addresses• 10.0.0.0 through 10.255.255.255 (1 Class A license)• 172.16.0.0. through 172.31.255.255 (16 Class B licenses)• 192.168.0.0 through 192.168.255.255 (256 Class C licenses)
– All other IP addresses are public IP addresses