Network layer topicsrouted protocol Routing – sending packets the right way... Layer 3 protocolA layer 3 protocol such as IP version 4 must: networks and individual hosts Encapsulate a
Trang 1OSI network layer
CCNA Exploration Semester 1
CCNA Exploration Semester 1
Chapter 5
Trang 2OSI network layer
TCP, UDP
IP
Ethernet, WAN technologies
HTTP, FTP, TFTP, SMTP etc
Segment
Packet
Frame Bits Data stream
Trang 3Network layer topics
routed protocol
Routing – sending packets the right way
Trang 4Purpose of layer 3
destination, then route it.
Trang 5Layer 3 protocol
A layer 3 protocol such as IP version 4 must:
networks and individual hosts
Encapsulate a segment from layer 4 into a
Encapsulate a segment from layer 4 into a
packet and include addresses
Direct the packet across one or many
networks to the destination host
give the segment to layer 4
Trang 6Network Layer – Communication from
Host to Host
Layer 3 uses four basic processes:
1 Addressing
2 Encapsulation
3 Routing: Intermediary devices that connect the networks
are called routers The role of the router is to select
are called routers The role of the router is to select
paths for and direct packets toward their destination
This process is known as routing.
4 Decapsulation
Trang 7Network layer protocols
common
to replace version 4 eventually
to replace version 4 eventually
(CLNS/DECNet)
Trang 8The roles of IPv4 protocol
IPv4 is currently the most widely-used version of IP
with low overhead It provides only the functions that are necessary to deliver a packet from a source to a destination over an interconnected system of
networks.
the flow of packets These functions are performed
by other protocols in other layers.
Trang 9IP characteristics
does only what it needs to do
with destination before sending packet
with destination before sending packet
delivery, no checking or resending
know maximum packet size
Trang 10IP does not notify the destination host.
Which layer 4 protocol on the sending host will establish a
connection?
TCP: A connection-oriented protocol
Which layer 4 protocol on the sending host will not establish a connection?
Trang 11Best Effort Service (unreliable)
Layer 3 (IP)
Speed over reliability
Unreliable: Does not have the capability or responsibility to
manage, and recover from, undelivered or corrupt packets.
Who does?
TCP at the end-to-end hosts
Trang 12Media Independent
Responsibility of the OSI Data Link layer to take an IP packet and prepare it for transmission over the communications medium
Transport of IP packets is not limited to any particular medium.
May need to fragment the packet if it is too many bits (later).
Trang 13Network layer encapsulation
Segment from transport layer
Packet header added to make
Packet header added to make
IP packet
Sent to data link layer for
further encapsulation into
frame
Trang 14IPv4 packet header fields
IP address of source
host, needed so reply
can be sent.
IP address of destination host, needed so routers can find route.
Trang 15IPv4 packet header fields
Reduced by 1 at each
router Packet dropped if
it goes to 0.
TCP or UDP used in Transport layer.
Trang 16Protocol field enables the Network layer to pass
the data to the appropriate upper-layer protocol.
01 ICMP
06 TCP
17 UDP
17 UDP
UNIX: 255
Linux: 64 or 255 depending upon vendor and version
Microsoft Windows 95: 32
Microsoft Vista: 128
Trang 17IPv4 packet header fields
Priority for QoS E.g
voice data has higher
priority than e-mail.
For checking if header has been corrupted.
Trang 18IPv4 packet header fields
Shows if packet has
been fragmented or
must not be fragmented.
If router has to split a packet, this gives order for putting pieces together.
Trang 19IP Fragmentation
Data = 1480 bytes IP
Data = 500 IP
Data = 480 IP
A router may have to fragment a packet when forwarding it from one
medium to another medium that has a smaller MTU.
Data = 520
L2 L2 go over my serial link all This packet is too big to
at once I need to break it into smaller fragments
Data = 520
Data = 500
Trang 20Network Layer Fields
• 0: This is the last fragment
• 1: More fragment follow this fragment
Trang 21IPv4 packet header fields
length.
Trang 22Splitting up networks
Fully switched network, each device has its own
bandwidth You could have hundreds of computers Why split it up?
Too large to manage efficiently
Too much broadcast traffic - congestion
Too many addresses for switches to remember
Lack of security
Trang 23How to split the network
resources do people use? How much
bandwidth do they use?
bandwidth do they use?
departments in a company, security
requirements
Trang 24Broadcast domain ? - Performance
A broadcast is a message sent from one host to all other hosts on the network.
Managing the size of broadcast domains by dividing a network into subnets or replace switch by router
Trang 26Hierarchical Addressing
devices communicating across networks of
networks
Trang 27IPv4 hierarchical address
32 bits in four 8-bit octets, written in decimal
Here network part (prefix) is 24 bits /24
Trang 28Message to same network
Trang 29Message to different network
Trang 30Default gateway
and a default gateway
router port on the same network as the PC
router port on the same network as the PC
other networks
has a different IP address
Trang 31packet header and decides what to do with
the packet next
Trang 32A Quick Look at Routing
A Quick Look at Routing
Trang 33Host Routing Table
netstat –r
or
Hosts also have a local routing table.
Usually only contains:
Its own network address (directly connected network)
Default gateway IP address
route print
Trang 34Network 192.168.2.0/24 Network 192.168.1.0/24
Routing – First Look
Routers know about:
Directly connected networks (C):
Network addresses of its interfaces
When a router is configured with the IP address/mask on an interface the router knows that it has an interface which is part of that network.
C 192.168.2.0/24 is direction connected, FastEthernet0/1
Trang 35Network 192.168.2.0/24 Network 192.168.1.0/24
Routing – First Look
Routers learn about remote networks using:
Static routes
Dynamic Routing Protocol (R = RIP)
Routes in a routing table have three main features:
Destination network
C 192.168.2.0/24 is direction connected, FastEthernet0/1
Trang 36Routing table and forwarding
a list of known networks and the best way to get there – outgoing port and address of next-hop router
hop router
It decides which network this address is on
If it knows the network it forwards the packet
If it does not know the network it drops the
packet
Trang 37Directly connected
The networks of the router’s own interfaces go into the routing table.
Trang 38Other networks
by an administrator (static routes)
using a routing protocol (dynamic routes)
using a routing protocol (dynamic routes)
unknown networks go on this route instead of being dropped
Trang 39Routing table entries
Directly connected shown by C
Trang 40Routing table entries
Static, configured by administrator, shown by S
Trang 41Routing table entries
Default, configured by administrator, shown by S*
Trang 42Routing table entries
Learned from another router using RIP routing protocol, shown by R
Trang 43Router has a route
Trang 44Routing protocols
in their routing tables.
A routing protocol is the set of rules they use to
swap information.
Interior Gateway Routing Protocol (IGRP), Open Shortest Path First (OSPF), Border Gateway
Protocol (BGP) and Enhanced IGRP (EIGRP
Trang 45Routed versus Routing
Routed protocol: used at the network layer
that transfer data from one host to another across a router
Routing protocols: allow routers to choose
Routing protocols: allow routers to choose
the best path for data from source to
destination
Internetwork Packet Exchange (IPX);
DECnet, AppleTalk, Banyan VINES, and
Xerox Network Systems (XNS)
Trang 46Default route
default route is a route that will match all destination networks In IPv4 networks, the address 0.0.0.0 is used for this purpose.
which there is no entry in the routing table for the
destination network.
does not match a more specific route in the routing table are forwarded to the nexthop router associated with the default route.
Trang 47Static routes Dynamic routes
administrator
different for each router
Trang 48Labs
Trang 49The End The End