1 Chapter 4: Network Layer Abdullah Konak School of Information Sciences and Technology Penn State Berks A. Konak IST 220/Ch4: Network Layer 2 Learning Objectives Describe Internet addressing Understand the functions of the network layer (IP) Understand Domain Name System and name resolution process Understand the concept of quality of service
20
Embed
CH4 Network Layer - Pennsylvania State Universitypersonal.psu.edu/.../teaching/portfolio/ist220/notes/CH4_Network_Layer.pdf · 4 A. Konak IST 220/Ch4: Network Layer 7 Addressing We
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Chapter 4:Network Layer
Abdullah KonakSchool of Information Sciences and TechnologyPenn State Berks
A. KonakIST 220/Ch4: Network Layer 2
Learning ObjectivesDescribe Internet addressingUnderstand the functions of the network layer (IP)Understand Domain Name System and name resolution processUnderstand the concept of quality of service
2
A. KonakIST 220/Ch4: Network Layer 3
Network Layer
Client Application:Web browser
Server Application:Web Server
Network Layer
Host-to-Host Delivery
The transport layer provides and
manages host-to-host delivery over arbitrary
networks.
The transport layer provides and
manages host-to-host delivery over arbitrary
networks.
A. KonakIST 220/Ch4: Network Layer 4
Duties
The network layer provides host-to-host delivery over same or different types of networks. This services are provided by the Internet Protocol (IP).Functions:
InternetworkingAddressingRoutingPacketizingFragmentingQuality of Service
3
A. KonakIST 220/Ch4: Network Layer 5
internetwork
The term internetwork refers to an arbitrary collection of networks interconnected to provide host-to-host packet delivery service.
Network 1, Ethernet IEEE 802
Host A Host B Workstation
Network 4FDDI Ring
Host E
Host F
Router 1
Router 2
Network 2, Ethernet IEEE 802
Host C Host D
Router 3Network 3
T1 Dedicated line(point-to-point)
A. KonakIST 220/Ch4: Network Layer 6
Router• Provides connections between networks (same or different
type) and routing and delivery of data between hosts from different networks.
Network Layer (IP)
Data Link(FDDI)
Physical(FDDI)
Data Link(Ethernet)
Physical(Ethernet)
Host C
FDDIRing
Host A
Host C
RouterEthernetInterface
1Interface
2
Host D
FDDI Frame Ethernet Frame
Physical connection
Connection inside the router
Optical Fiber Cable Twisted Pair Cable
4
A. KonakIST 220/Ch4: Network Layer 7
Addressing
We need to uniquely identify each device on the Internet. We need an addressing system that can be universally understood by each device on the Internet.
A. KonakIST 220/Ch4: Network Layer 8
IP Address
Every host on a TCP/IP network must have a unique IP address, which is a 32-bit number (4-octet) that identifies both the host and the network on which the host is located.
IP addresses are expressed in dotted-decimal format, such as
Calculate the maximum and minimum possible decimal numbers for an octet of the IP address? Calculate the maximum number of devices that can be connected to the Internet using a unique IP address?
IP identifies both the host and the networkon which the host is located.Subnet Mask (SM) is a 32-bit number which identifies which part of the IP is the network address and which part is the host address.
Identify the network and host addresses in the following examples.
1. IP=128.168.1.90 and SM=255.255.0.02. IP=192.168.1.90 and SM=255.255.255.03. IP=192.168.1.90 and SM=255.255.0.2554. IP= 30.0.0.1 and SM=255.0.0.0
A. KonakIST 220/Ch4: Network Layer 12
Network and Host IDIn TCP/IP networks, two host can directly communicate if they share the same network (subnetwork) IP. IP=181.74.*.* with Subnet Mask=255.255.0.0
RouterRouter
The Router’s Internal Address(The Gateway Address for the site)
The Router’s Internal Address(The Gateway Address for the site)
255.255.255.0255.255.0.0255.0.0.0Default Subnet Mask25465,53416,777,214Number of Hosts2,097,15216,384126Number of Networks81624Host ID Bits24168Network ID Bits192-223128-1911 -127First Octet Values110100First Bits
Class CClass BClass A
0
1 0
01 1
A. KonakIST 220/Ch4: Network Layer 14
Example: Class C
IP=192.168.1.* and Subnet Mask=255.255.255.0192.168.1.0 Network IP (NOT a valid host IP)192.168.1.1 1st host IP192.168.1.2 2nd host IP192.168.1.3 3rd host IP. . .. . .192.168.1.254 254th host IP192.168.1.255 Broadcast IP (NOT a valid host IP)
Valid Host IPs
8
A. KonakIST 220/Ch4: Network Layer 15
Example: Class BIP=165.168.*.* and Subnet Mask=255.255.0.0
165.168.0.0 Network IP (NOT a valid host IP)165.168.0.1 1st host IP165.168.0.2 2nd host IP165.168.0.3 3rd host IP: : :165.168.0.255 255th host IP165.168.1.0 256th host IP
: : :165.168.255.254 65,534th host IP165.168.255.255 Broadcast IP (NOT a valid host IP)
Valid Host IPs
A. KonakIST 220/Ch4: Network Layer 16
Example: Class AIP=30.*.*.* and Subnet Mask=255.0.0.0
30.0.0.0 Network IP (NOT a valid host IP)30.0.0.1 1st host IP30.0.0.2 2nd host IP30.0.0.3 3rd host IP: : :30.0.0.255 255th host IP30.0.1.0 256th host IP
: : :30.255.255.254 16,777,214th host IP30.255.255.255 Broadcast IP (NOT a valid host IP)
Valid Host IPs
9
A. KonakIST 220/Ch4: Network Layer 17
Network, Subnet, and Host IDClass B IP=181.74.*.* with Class C Subnet Mask=255.255.255.0
A. KonakIST 220/Ch4: Network Layer 18
Private IP Addresses
Workstations protected by firewalls and computers that do not connect to the Internet can use unregistered, private IP addresses.When building a private network, you should use one of the special ranges of private IP addresses, rather than assigning IP addresses randomly.
192.168.0.0 through 192.168.255.255
C
172.16.0.0 through 172.31.255.255
B
10.0.0.0 through 10.255.255.255
A
Network AddressesClass
10
A. KonakIST 220/Ch4: Network Layer 19
NAT (network address translation )
In NAT, the source and/or destination addresses of IP packets are rewritten as they pass through a router.
192.168.0.2
192.168.0.3
192.168.0.4
192.168.0.5
Internet
192.168.0.2192.168.0.3
68.72.1.168.72.1.2
RegisteredPublic IP
PrivateInternal IP
192.168.0.1 68.72.1.3
Router(Firewall)
192.168.0.2 68.72.1.1
68.72.1.2192.168.0.3
192.168.0.4 68.72.1.3
68.72.1.3192.168.0.5
Source IPInside
Source IPOutside
192.168.0.2 68.72.1.1
68.72.1.2192.168.0.3
Destination IPInside
Destination IPOutside
192.168.0.4
192.168.0.5
Hosts 4 and 5 are notdirectly accessible fromoutside
A. KonakIST 220/Ch4: Network Layer 20
Network Address Port Translation (used by broadband home routers)
192.168.0.2
192.168.0.3
192.168.0.4
192.168.0.5
Internet
192.168.0.2192.168.0.3
8020-21
Port PrivateInternal IP
192.168.0.1 68.72.1.3
Router(Firewall)
192.168.0.2 68.72.1.3
68.72.1.3192.168.0.3
192.168.0.4 68.72.1.3
68.72.1.3192.168.0.5
Source IPInside
Source IPOutside
192.168.0.2 68.72.1.3:80
68.72.1.3:21192.168.0.3
Destination IPInside
Destination IPOutside: Port Number
192.168.0.4
192.168.0.5
Hosts 4 and 5 are notdirectly accessible fromoutside
11
A. KonakIST 220/Ch4: Network Layer 21
DMZ Host at Home Networks
192.168.0.2
192.168.0.3
192.168.0.4
192.168.0.5
Internet192.168.0.1 68.72.1.3
Router(Firewall)
68.72.1.3
DMZ Host A DMZ host behaves as if itis directly connected to theInternet.
A. KonakIST 220/Ch4: Network Layer 22
General Guidelines for IP Address Assignments
The first octet of the network ID cannot be 127, 127.0.0.1 is the loopback address in IP. Given an IP and Subnet Mask
The first IP identifies network.The last IP is reserved for broadcast messages.
The host ID of each computer must be unique in a local area network.A registered network ID is required for connecting to the Internet.Each host requires a subnet mask.
12
A. KonakIST 220/Ch4: Network Layer 23
Domain Name System (DNS) and Address Resolution
Dotted decimal notation IP is not convenient for users, who can more easily remember names than numerical addresses.DNS is a name-to-address directory service that performs name-to-address resolution.
DNS Server
www.psu.edu
DNSDatabase 146.186.157.6
domain name
ip addressUser
A. KonakIST 220/Ch4: Network Layer 24
Number of Host Computers
13
A. KonakIST 220/Ch4: Network Layer 25
Hierarchical Structure of DNS
A. KonakIST 220/Ch4: Network Layer 26
The DNS Database
The DNS database is divided into thousands of contiguous and separately managed zones, which are managed by separate administrators.
14
A. KonakIST 220/Ch4: Network Layer 27
Name Resolution Process
target: www.microsoft.com
psu.edu
Name resolution is the process of resolving domain names to IP addresses.
A. KonakIST 220/Ch4: Network Layer 28
Name Servers
A DNS name server stores the zone database file.A DNS name server has the final authority for its zone. A zone can have multiple name servers associated with it.Domain names and their corresponding IPsare also cached in local computers
type "ipconfig /displaydns" in the command prompt to list the cached domain names.
15
A. KonakIST 220/Ch4: Network Layer 29
In Microsoft XP
A. KonakIST 220/Ch4: Network Layer 30
Routing
Routing packets over different networks is the main faction of the network layer and the IP protocol
16
A. KonakIST 220/Ch4: Network Layer 31
Routing Decisions
Criteria: Delay or ReliabilityTechnique: Next-hop routing or path vector routing.
A. KonakIST 220/Ch4: Network Layer 32
Routing Tables (Next-hop routing)
192.168.3.0 (S2)Net 192.168.3.0
Router 1 Routing Table
192.168.3.0 (S2)Net 192.168.4.0
192.168.2.0 (S1)Net 192.168.2.0
192.168.1.0 (S0)Net 192.168.1.0
Then forward the packet tonetwork (Interface)
If The Destination Network is
Net 192.168.3.0 (S0)Net 192.168.3.0
Router 2 Routing Table
Net 192.168.4.0 (S1)Net 192.168.4.0
Net 192.168.3.0 (S0) Net 192.168.2.0
Net 192.168.3.0 (S0)Net 192.168.1.0
Then forward the packet tonetwork (Interface)
If The Destination Network is
Network192.168.1.0
Network192.168.2.0
interface S0
interface S1
interfaceS2 192.168.4.0interface
S1Network
192.168.3.0interface
S0 Router 2Router 1
17
A. KonakIST 220/Ch4: Network Layer 33
Routing Tables
Routing tables for the Internet are usually Routing tables for the Internet are usually networknetwork--specific rather than hostspecific rather than host--specific. specific. The router routes the packet to the final The router routes the packet to the final network; it is then broadcast to reach the final network; it is then broadcast to reach the final destination. destination. NetworkNetwork--based routing reduces the size of based routing reduces the size of routing tables.routing tables.
A. KonakIST 220/Ch4: Network Layer 34
Static vs Dynamic Routing
Static Routing: Information is entered manually and does not change automatically.Dynamic Routing: Routing tables are created and maintained by router dynamically using a routing protocol.
18
A. KonakIST 220/Ch4: Network Layer 35
Hierarchical Routing: Autonomous System• Routing in the Internet is hierarchical. Delivery is first
made to the autonomous system, then to the network, and finally to the host. Hierarchical routing reduces the size of the routing tables.
A
BC
D
E
F
G
I
J
K
KL
M
N
O
P
R
Exterior Router
Interior Router
Router XS1
S2
A. KonakIST 220/Ch4: Network Layer 36
Routing Protocols
Routers in the Internet inform each other and update their tables using routing protocols such asRouting Information Protocol (RIP)
A router shares its routing table with its neighbors by sending the routing table to them at fixed intervals.
Open Shortest Path First (OSPF)Border Gateway Protocol (BGP)
19
A. KonakIST 220/Ch4: Network Layer 37
Routing Information Protocol (RIP)
NetworkA
NetworkB
S0 S2
S1 NetworkDS1
NetworkC S0
S0 NetworkES1
Router 4
NetworkF
S1
S0
Destination Interface HopsRouter 1
A S0 0C S1 0
Destination Interface HopsRouter 2
B S2 0C S0 0D S1 0
Destination Interface HopsRouter 3
D S0 0E S1 0
Destination Interface HopsRouter 4
E S0 0F S1 0
Router 3Router 2Router 1
A. KonakIST 220/Ch4: Network Layer 38
RIP Exercise:
1. Router 1 sends its table to Router 2. Update the Router 2 Table.
2. Router 2 sends its table (updated) to Router 3. Update the Router 3 Table.
3. Router 4 sends its table to Router 3. Update the Router 3 Table.
4. Router 3 sends its table to Router 2. Update the Router 2 Table.
5. Router 2 sends its table to Router 1. Update the Router 1 Table.