03_tcom5272_tcpip

Download Report

Transcript 03_tcom5272_tcpip

TCOM 5272
Telecomm Lab
Dr. Mostafa Dahshan
OU-Tulsa 4W 2nd floor
660-3713
[email protected]
M. Dahshan - TCOM5272
1
Acknowledgements
 Most of the notes and figures in this
presentation are imported from
 Notes by Dr. Anindya Das
 Textbook supplemental material
 CCNA Intro Exam Certification Guide
M. Dahshan - TCOM5272
2
The TCP/IP Protocol
 TCP/IP combination
 TCP (Transmission Control Protocol)
 IP (Internet Protocol)
 TCP/IP has become most widely used
protocol suite
M. Dahshan - TCOM5272
3
TCP/IP Features
 Used worldwide on most networks and the
Internet
 Influences design of wide range of network
devices
 Main protocol of most computer operating
systems
 Subject to many troubleshooting and
network analysis tools
 Understood by large body of network
professionals
M. Dahshan - TCOM5272
4
TCP/IP Protocol Suite
M. Dahshan - TCOM5272
5
How TCP Works
 TCP is Layer 4 (Transport Layer) protocol
 Establishes sessions between network nodes
 Sequences and acknowledges frames
 For reliable end-to-end delivery
 Sequence number placed in TCP frame header
 Shows frame sequence in stream of frames
 Indicates amount of data in frames
 Sequence number checked for frame correctness
 Sliding window: number of data bytes in frame
 May be dynamically adjusted if two nodes agree
M. Dahshan - TCOM5272
6
TCP Frame Format
 TCP segment: header and data payload in TCP frame
 TCP header contains 11 fields
M. Dahshan - TCOM5272
7
Common TCP Port Numbers
Full list available at www.iana.org/assignments/port-numbers
M. Dahshan - TCOM5272
8
User Datagram Protocol (UDP)
 Operates at OSI Layer 4 (like TCP)
 Connectionless protocol
 No flow control, sequencing, or
acknowledgment
 Relies only on checksum to ensure
reliability
 Alternative to TCP when high
reliability not required
M. Dahshan - TCOM5272
9
UDP Frame Format
 Frame has four-field header and data
M. Dahshan - TCOM5272
10
Internet Protocol (IP)
 IP Functions





Data transfer
Packet addressing
Packet routing
Fragmentation
Detection of errors
M. Dahshan - TCOM5272
11
IP Packet Format
 Datagram: TCP/UDP segment formatted with IP header
 IP packet header consists of 13 fields
M. Dahshan - TCOM5272
12
M. Dahshan - TCOM5272
13
IP Addressing
 Dotted decimal notation: IP address format
 Four fields totaling 32 bits
 Fields are decimal values representing 8-bit
binary octets
 Part of address is network ID, part is host ID
 Example in decimal format: 129.5.10.100
 Three types of transmission
 Unicast: packet sent to each requesting client
 Multicast: packet sent to group of requesting
clients
 Broadcast: communication sent to all network
nodes
M. Dahshan - TCOM5272
14
Address Classes
M. Dahshan - TCOM5272
15
Address Classes (2)
M. Dahshan - TCOM5272
16
Subnet Mask
 TCP/IP requires configured subnet mask
 Subnet mask used for two purposes
 Show class of addressing used
 Divide networks into subnetworks to control
traffic
 Example of a subnet mask:
 11111111.00000000.00000000.00000000
(255.0.0.0)
 Indicates Class A network
 Ones represent network/subnet identification
bits
 Zeroes represent host identification bits
M. Dahshan - TCOM5272
17
Network Addresses
 Is the address of
the “wire”
 Each router
interface must be
on a separate
subnet
 Each subnet is its
own broadcast
domain
 Routing tables
store information
about network
addresses, not
host addresses
M. Dahshan - TCOM5272
18
IP Subnetting
 Subnetting allows larger number of
network addresses, unrestricted by
traditional address classes
 Classes A,B,C can be subdivided into
smaller non-overlapping subnet
groups
M. Dahshan - TCOM5272
19
Why Subnetting?
 Number of networks is limited
 We need 10 LANs but we have only 1
class C network
 Reduce broadcast domain traffic
 Can you imagine what the network traffic
overhead would be like on a network
with 254 hosts trying to discover each
others MAC addresses?
M. Dahshan - TCOM5272
20
Subnetting Example
Class B network with subnetting
Address formats with subnetting
M. Dahshan - TCOM5272
21
Subnet Calculation
 To correctly subnet a given network
address into subnet addresses, ask yourself
the following questions:
1.
2.
3.
4.
How many bits do I need to borrow?
What’s the subnet mask?
What’s the “magic number” or multiplier?
What are the first three subnet addresses?
 Let’s look at each of these questions in
detail
M. Dahshan - TCOM5272
22
1. How many bits to borrow?
 First, you need to know how many
bits you have to work with
 Second, you must know either how
many subnets you need or how many
hosts per subnet you need
 Finally, you need to figure out the
number of bits to borrow
M. Dahshan - TCOM5272
23
1. How many bits to borrow?
 How many subnets or hosts do I need?
 A simple formula:
 Total Bits = Bits Borrowed + Bits Left
 TB = BB + BL
 I need x subnets: 2BB  2  x  BB  log2  x  2
 I need x hosts:
2BL  2  x  BL  log2  x  2
 Remember: we need to subtract two to
provide for the subnetwork and broadcast
addresses
M. Dahshan - TCOM5272
24
1. How many bits to borrow?
 Class C Example: 210.93.45.0
 Design goals specify at least 5 subnets so
how many bits do we borrow?
 How many bits in the host portion do we
have to work with (TB)?
 What’s the BB in our TB = BB + BL
formula? (8 = BB + BL)
 2 to the what power will give us at least 5
subnets?
3
2 - 2 = 6 subnets
M. Dahshan - TCOM5272
25
1. How many bits to borrow?
 How many bits are left for hosts?
TB = BB + BL
8 = 3 + BL
BL = 5
 So how many hosts can we assign to
each subnet?
25 - 2 = 30 hosts
M. Dahshan - TCOM5272
26
1. How many bits to borrow?
 Class B Example: 185.75.0.0
 Design goals specify no more than 126
hosts per subnet, so how many bits do we
need to leave (BL)?
 How many bits in the host portion do we
have to work with (TB)?
 What’s the BL in our TB = BB + BL
formula? (16 = BB + BL)
 2 to the what power will insure no more
than 126 hosts per subnet and give us the
most subnets?
27 - 2 = 126 hosts
M. Dahshan - TCOM5272
27
1. How many bits to borrow?
 How many bits are left for subnets?
TB = BB + BL
16 = BB + 7
BL = 9
 So how many subnets can we have?
29 - 2 = 510 subnets
M. Dahshan - TCOM5272
28
2. What’s the subnet mask?
 We determine the subnet mask by adding up the
decimal value of the bits we borrowed.
 In the previous Class C example, we borrowed 3
bits. Below is the host octet showing the bits we
borrowed and their decimal values.
1
1
1
128
64
32
16
8
4
2
1
We add up the decimal value of these bits and get 224.
That’s the last non-zero octet of our subnet mask
So our subnet mask is 255.255.255.224
M. Dahshan - TCOM5272
29
3. What’s the “magic number?”
 To find the “magic number” or the
multiplier we will use to determine
the subnetwork addresses, we
subtract the last non-zero octet from
256
 In our Class C example, our subnet
mask was 255.255.255.224. 224 is
our last non-zero octet
 Our magic number is 256 - 224 = 32
M. Dahshan - TCOM5272
30
Last Non-Zero Octet
 Memorize this table. You should be able to:
 Quickly calculate the last non-zero octet when given
the number of bits borrowed.
 Determine the number of bits borrowed given the last
non-zero octet.
 Determine the amount of bits left over for hosts and
the number of host addresses available.
Bits
Non-Zero
Borrowed Octet
Hosts
2
192
62
3
224
30
4
240
14
5
248
6
6
252
2
M. Dahshan - TCOM5272
31
4. What are the subnets?
 We now take our “magic number” and use
it as a multiplier
 Our Class C address was 210.93.45.0
 We borrowed bits in the fourth octet, so
that’s where our multiplier occurs
 1st subnet: 210.93.45.32
 2nd subnet: 210.93.45.64
 3rd subnet: 210.93.45.96
 We keep adding 32 in the fourth octet to
get all six available subnet addresses
M. Dahshan - TCOM5272
32
Host & Broadcast Addresses
 Now you can see why we subtract 2 when
determining the number of host address
 Let’s look at our 1st subnet: 210.93.45.32
 What is the total range of addresses up to our
next subnet, 210.93.45.64?
 210.93.45.32 to 210.93.45.63 or 32 addresses
 .32 cannot be assigned to a host. Why?
 .63 cannot be assigned to a host. Why?
 So our host addresses are .33 - .62 or 30 host
addresses--just like we figured out earlier
M. Dahshan - TCOM5272
33
CIDR Notation
 Classless Interdomain Routing is a method
of representing an IP address and its
subnet mask with a prefix
 For example: 192.168.50.0/27
 What do you think the 27 tells you?
 27 is the number of 1 bits in the subnet mask
Therefore, 255.255.255.224
 Also, you know 192 is a Class C, so we borrowed
3 bits!!
 Finally, you know the magic number is 256 - 224
= 32, so the first useable subnet address is
192.168.50.32!!
 Let’s see the power of CIDR notation
M. Dahshan - TCOM5272
34
202.151.37.0/26
 Subnet mask?
 255.255.255.192
 Bits borrowed?
 Class C so 2 bits borrowed
 Magic Number?
 256 - 192 = 64
 First useable subnet address?
 202.151.37.64
 Third useable subnet address?
 64 + 64 + 64 = 192, so 202.151.37.192
M. Dahshan - TCOM5272
35
198.53.67.0/30
 Subnet mask?
 255.255.255.252
 Bits borrowed?
 Class C so 6 bits borrowed
 Magic Number?
 256 - 252 = 4
 Third useable subnet address?
 4 + 4 + 4 = 12, so 198.53.67.12
 Second subnet’s broadcast address?
 4 + 4 + 4 - 1 = 11, so 198.53.67.11
M. Dahshan - TCOM5272
36
200.39.89.0/28
 What kind of address is 200.39.89.0?




Class C, so 4 bits borrowed
Last non-zero octet is 240
Magic number is 256 - 240 = 16
32 is a multiple of 16 so 200.39.89.32 is
a subnet address--the second subnet
address!!
 What’s the broadcast address of
200.39.89.32?
 32 + 16 -1 = 47, so 200.39.89.47
M. Dahshan - TCOM5272
37
194.53.45.0/29
 What kind of address is 194.53.45.26?





Class C, so 5 bits borrowed
Last non-zero octet is 248
Magic number is 256 - 248 = 8
Subnets are .8, .16, .24, .32, ect.
So 194.53.45.26 belongs to the third subnet
address (194.53.45.24) and is a host address.
 What broadcast address would this host use
to communicate with other devices on the
same subnet?
 It belongs to .24 and the next is .32, so 1 less is
.31 (194.53.45.31)
M. Dahshan - TCOM5272
38
No Worksheet Needed!
 After some practice, you should never need
a subnetting worksheet again
 The only information you need is the IP
address and the CIDR notation
 For example, the address 221.39.50/26
 You can quickly determine that the first
subnet address is 221.39.50.64. How?
 Class C, 2 bits borrowed
 256 - 192 = 64, so 221.39.50.64
 For the rest of the addresses, just do
multiples of 64 (.64, .128, .192).
M. Dahshan - TCOM5272
39
Activity 1: Practice On Your Own
 Below are some practice problems. Take out
a sheet of paper and calculate...
1.
2.
3.
4.
5.
6.
7.
 Bits borrowed
 Last non-zero octet
 Second subnet address and broadcast address
192.168.15.0/26
220.75.32.0/30
200.39.79.0/29
195.50.120.0/27
202.139.67.0/28
Challenge: 132.59.0.0/19
Challenge: 64.0.0.0/16
M. Dahshan - TCOM5272
40
M. Dahshan - TCOM5272
41
Router’s Functions
 A router is responsible for
determining the packet’s path and
switching the packet out the correct
port.
 A router does this in five steps:
1. De-encapsulates the packet
2. Performs the ANDing operation
3. Looks for entry in routing table
4. Re-encapsulates packet into a frame
5. Switches the packet out the correct
interface
M. Dahshan - TCOM5272
42
Routed Protocols
 Routed protocols are protocols that enable
data to be transmitted across a collection of
networks or internetworks using a
hierarchical addressing scheme
 Examples include IP, IPX and AppleTalk
 A routable protocol provides both a network
and node number to each device on the
network. Routers AND the address to
discover the network portion of the address
 An example of a protocol that is not
routable is NetBEUI because it does not
have a network/node structure
M. Dahshan - TCOM5272
43
Routing Protocols
 A routing protocol is a protocol that
determines the path a routed protocol will
follow to its destination
 Routers use routing protocols to create a
map of the network
 These maps allow path determination and
packet switching
 Maps become part of the router’s routing
table
 Examples of routing protocols include: RIP,
IGRP, EIGRP, & OSPF
M. Dahshan - TCOM5272
44
Multi-protocol Routing
 Routers are capable of running multiple routing
protocols (RIP, IGRP, OSPF, etc.) as well as running
multiple routed protocols (IP, IPX, AppleTalk)
 For a router to be able use different routing and routing
protocols, you must enable the protocols using the
appropriate commands.
M. Dahshan - TCOM5272
45
Dynamic Routing
 Dynamic routing refers to the process of allowing the
router to determine the path to the destination
 Routing protocols enable dynamic routing where
multiple paths to the same destination exist
M. Dahshan - TCOM5272
46
Static Routing
 Static routing means that the network administrator
directly assigns the path router are to take to the
destination
 Static routing is most often used with stub networks
where only one path exists to the destination
M. Dahshan - TCOM5272
47
Default Routes
 A default route is usually to a border or
gateway router that all routers on a
network can send packets to if they do not
know the route for a particular network
M. Dahshan - TCOM5272
48
Routing Protocol Classes
 Distance–vector: determines the
route based on the direction (vector)
and distance to the destination
 Link-state: each node recreates an
exact topology of the network in its
routing table
 Hybrid: combines aspects of both
M. Dahshan - TCOM5272
49
Distance-Vector Routing


Each router receives a routing table periodically from its
directly connected neighboring routers.
For example, in the graphic, Router B receives information
from Router A. Router B adds a distance-vector number
(such as a number of hops), and then passes this new
routing table to its other neighbor, Router C
M. Dahshan - TCOM5272
50
Link-State Routing


Link-state protocols maintain complex databases that
summarize routes to the entire network
Each time a new route is added or a route goes down, each
router receives a message and then recalculates a spanning
tree algorithm and updates its topology database
M. Dahshan - TCOM5272
51
Comparison
DISTANCE-VECTOR
LINK-STATE
Views network topology from
neighbor’s perspective
Gets common view of entire
network topology
Adds distance vectors from
router to router
Calculates the shortest path to
other routers
Frequent, periodic updates:
slow convergence
Event triggered updates: fast
convergence
Passes copies of routing tables Passes link-state routing updates
to neighbors
to all routers in the system.
M. Dahshan - TCOM5272
52
Hybrid Routing
 Cisco’s proprietary routing protocol,
EIGRP, is considered a hybrid
 EIGRP uses distance-vector metrics.
However, it uses event-triggered
topology changes instead of periodic
passing of routing tables
M. Dahshan - TCOM5272
53
Example Routing Protocols
 Distance-Vector
 Routing Information Protocol (RIP)
 Interior Gateway Routing Protocol (IGRP)
 Link-State
 Open Shortest Path First (OSPF)
 Integrated IS-IS
 Hybrid
 Enhanced IGRP (EIGRP)
M. Dahshan - TCOM5272
54
Convergence
 Convergence means that all routers share
the same information about the network.
In other words, each router knows its
neighbor routers routing table
 Every time there is a topology change,
routing protocols update the routers until
the network is said to have converged
again
 The time of convergence varies depending
upon the routing protocol being used
M. Dahshan - TCOM5272
55
M. Dahshan - TCOM5272
56
Homework
 Homework problems will be posted on
D2L
M. Dahshan - TCOM5272
57