Network Layerx

Download Report

Transcript Network Layerx

CSC 412 – Networking
Scott Heggen
Agenda
 Today


The Network Layer (Chapter 5)
Discussion on A2: The Data Link Layer
 Thursday


Q2: The Networking Layer
A2: The Data Link Layer Due
Navigating a Network
 Say you want to drive from Berea, KY to Beverly
Hills, CA. How would you get there?
 Networks use much of the same process:
 Data is passed around the local network
 To leave the network, data must reach the gateway
router
 The gateway router decides which route is best to
reach the destination, and forwards the packet to the
next router
 The process continues from router to router until the
packet reaches it’s destination’s gateway router
 The packet is passed around the receiver’s local
network until it reaches it’s destination
Routing
 Routing is the process by which data is
passed through specific networks until it
reaches the destination computer’s network
(and eventually, the destination computer)
The Postmaster General
 Every mailing address in the U.S. has a
unique address, consisting of a zip code,
state, city, and address
 In a network, every device has a unique
address, known as an Internet Protocol (IP)
Address
 The IP protocol defines addressing, as well
as routing
IP Header
 IP defines a 20-byte long header



4 bytes are used for the source IP address
4 bytes are used for the destination IP address
The other 12 bytes are used for other
functions, which we will cover later
Comparing Protocols
HTML Data
HTTP Header
Layer 4: Transport
Segment
Data
TCP Header
Data
Layer 3: Network
IP Header
Data
Packet
Layer 2: Data Link
Frame
Ethernet Header
Data
IP routing
 What kind of addresses does OSI Layer 2
use?
 What kind of addresses does OSI Layer 3
use?
 When do we actually use these addresses?
MAC vs. IP
 Why not use MAC addresses for everything?
IP Addresses
 An IP address consists of 32 bits:
 00001000 00101000 00011101 01110000
 To make it easier to read, IP addresses are typically
expressed in dotted decimal format:

8.40.29.112
 Each decimal value in an IP address is called an
octet; one IP address consists of 4 octets
 For now, IP addresses will be in dotted decimal form;
later, you will need to be able to convert between
dotted decimal and binary
Binary / Decimal Conversions
 Let’s practice. Convert the following binary
values to dotted decimal:



01001010 . 11000101 . 00100010 . 10000010
11010011 . 01010101 . 10101010 . 11111011
11001100 . 00110011 . 00011100 . 11100011
 And dotted decimal to binary:



123.45.67.89
254.0.12.99
99.100.128.129
IP Networks
 All devices in a LAN should have the same
network numbers
 This allows routers to easily identify where
sets of IP addresses are located
IP Routing
 Does a router need to know where every
unique IP address is located?
 A router only needs to know where to forward
a packet destined for each set of addresses
 These groups of addresses are known as IP
Networks
Network Numbers
 A portion of an IP address defines the IP
network
 This portion, followed by binary zeros, is
known as the network number

I.E. IP Address 3.3.3.3 belongs to the network
number 3.0.0.0
Classes of Networking
 Three classes of networks:
10 . 20 . 30 . 40
Classful IP Addressing
Classful IP Addressing
Routing
 R1 and R2 need to know:



How to route a packet to the network
8.0.0.0
How to route a packet to the network
130.4.0.0
How to route a packet to the network
199.1.1.0
Classful IP Addressing
 What if one network was a Class A network
with a network address of 8.0.0.0, and
another network was a Class B network with
a network address of 8.1.0.0?
 The IP protocol defines a range of network
numbers for each class, to avoid overlaps
00…
10…
11…
IP addresses
 Identify the Class, Network number, and
range of IP addresses:




192.168.1.1
10.1.4.3
126.0.0.0
255.255.255.255
Reserved Classes
IP Addressing Fundamentals
 Rules Concerning IP Addresses





They must be unique inside a particular network
They are 32-bit numbers
They are typically written and displayed as
dotted-decimal numbers (e.g., 192.168.1.2)
Each decimal number in a dotted-decimal IP
address represents 8 bits of the IP address (often
called an octet)
Each of the four octets in an IP address are
between decimal 0 and 255
IP Addressing Fundamentals
 IP Network Rules:
 Devices on the same LAN should use IP
addresses in the same group; the group is
called an IP network
 Devices on different LANs that are separated
by at least one router should use IP addresses
in different IP networks
 IP addresses must be individually unique
inside the same IP network
IP Networks
IP Classes
 Three networks:


What class is each?
Is this a legal network?
Network and Broadcast Address
 When all the host numbers are binary 0’s, the
address is considered the network address
 When all the host numbers are binary 1’s, the
address is considered the broadcast address
 All the values between the network and broadcast
addresses are considered valid, usable IP addresses
for that network
Network address: 192.168.1.0
Broadcast address: 192.168.1.255
IP Addressing
 Determine the network address, broadcast
address, and valid range of IP addresses for
each IP address:






24.92.0.0
203.0.0.255
1.1.1.1
142.255.255.255
222.255.255.0
100.0.0.0
IP Addressing
 Determine:
 The number and location of each network
 The network number for each network
 The broadcast IP address for each network
 The range of valid IP addresses in each network
F0/1
192.168.7.2
192.168.7.254
F0/2
222.130.6.2
F0/1
222.130.6.9
F0/2
101.1.10.4
F0/1
101.7.10.4
F0/2
135.16.8.33
135.16.65.254
IP Addressing
 Determine what is wrong with the
following network:
F0/1
192.168.7.2
192.168.7.255
F0/2
222.130.6.2
F0/1
222.130.6.0
F0/2
101.1.10.4
F0/1
101.7.10.4
F0/2
135.16.8.33
135.16.8.33