Title: Computer Networking
1Computer Networking
2Bits and Bytes
- Putting information into a form that a computer
can deal with - A 01000001
- B 01000010
3Information Encoding
-
- 065 01000001 A
- 066 01000010 B
- 067 01000011 C
- 068 01000100 D
- 069 01000101 E
- 070 01000110 F
- 071 01000111 G
-
4Review (maybe)
- Have a bit
- 0 or 1
- Take a whole byte
- Eight bits
- R represents a letter or numeral or punctuation
mark
5Transmission of Information
- Bandwidth
- Bits per second
- Kilo
- Mega
- Giga
6A Computer Network
- What is a computer network?
- A network is a collection of computers or
computer-like devices that can communicate across
a common transmission medium.
7A Computer Network
- In a network, requests and data from one computer
pass across the transmission medium (which might
be a network cable or a phone line) to another
computer. - Example four node network
8A Computer Network
- A computer interacts with the world through one
or more applications (software) that perform
specific tasks and manage input and output. - If that computer is part of a network, then some
of those applications must be capable of
communicating with applications on other network
computers.
9A Computer Network
- A network protocol is a system of common rules
that helps to define the complex process of
transferring data. The data travels from an
application on one computer, through the
computers network hardware, across the
transmission medium to the correct destination,
and up through the destination computers network
hardware to a receiving application.
10Computer Network
Transmission medium
11A Computer Network
- A network is usually described as being a local
area network (LAN) or a wide area network (WAN)
12Local Area Network (LAN)
- Many types of LAN technologies have existed over
the years - One predominant LAN technology exists today -
Ethernet
13Ethernet
- Contention media access method
- Allows many computers on the same network to
share the same bandwidth (basically share a
common medium or connection) - Easily scalable easy to improve and incorporate
new technology as it becomes available
14Ethernet
- Uses Carrier Sense Multiple Access with Collision
Detect (CSMA/CD) - CSMA/CD is a protocol designed to allow multiple
computers to share the network medium
successfully - Designed to manage collisions
15Ethernet
- What is a collision?
- (example of four node 10Base-2 network)
- All computers share the connection
- Only one can transmit at a time
- Suppose computer C is transmitting information to
computer D - C takes over the wire sends electrical
signals onto the wire
16Ethernet
- All computers on the network detect the
transmission - Only D will process the transmitted data because
C has addressed the information to D - A collision will occur if two computers attempt
to transmit at the same time (like a group of
people talking at a party)
B
17Ethernet
- CSMA/CD if a transmitting computer detects
another computer attempting to transmit, it sends
out a long jam signal that causes all computers
on the network to be silent - A back off scheme is used to figure out who
gets to transmit first
18Ethernet
- On a busy Ethernet network collisions can be a
big problem - SLOW!
19Types of Ethernet
- Ethernet was initially developed by Digital
Equipment Corporation, Intel, and Xerox - The IEEE took their design and created the
official network standard - The IEEE called this standard 802.3
- 802.3 is the family name for all wired Ethernet
types
20Types of Ethernet 10Base2
- 10Mbps
- Baseband technology
- 185 meters (length) almost 200 meters
- 30 devices per segment
- Uses coaxial cable (coax), BNC and T-connectors
to connect to a network - Referred to as thinnet
21Types of Ethernet 10Base5
- 10Mbps
- 500 meters (length)
- Up to 2500 meters with repeaters
- Up to 1024 devices for all segments
- Uses a large (thick) coaxial cable
- Referred to as thicknet
22Types of Ethernet 10BaseT
- 10Mbps
- Uses Category 3 UTP wiring (phone wire)
- Each device connects to a hub or switch
- Only one device per segment (or wire)
- Uses RJ-45 connectors
- Supports a star topology
23Types of Ethernet 100BaseT(X)
- 100Mbps
- Uses Category 5,6, or 7 UTP wiring
- Up to 100 meters (length)
- Only one device per segment (or wire)
- Uses RJ-45 connectors
- Supports a star topology
24Types of Ethernet 100BaseFX
- 100Mbps
- Uses fiber optic cabling
- Up to 412 meters (length)
- Used for point-to-point connections
- Uses ST or SC connectors
25Types of Ethernet 1000BaseT
- 1000Mbps
- Up to 100 meters (length)
- Category 5, 6, or 7 UTP wiring
- Only one device per segment (or wire)
- Uses RJ-45 connectors
- Supports a star topology
26Types of Ethernet 1000BaseSX
- 1000Mbps
- Uses fiber optic cabling
- Up to 550 meters (length) depending upon the size
of the cable - Uses a 850 nanometer laser
- Uses ST or SC connectors
27Types of Ethernet 1000BaseLX
- 1000Mbps
- Uses fiber optic cabling (multi-mode or
single-mode) - Up to 10 kilometers depending on type of cable
used - Uses a 1300 nanometer laser
28Ethernet Addressing
- Media Access Control (MAC) address is stored on
every Ethernet network interface card - 48 bits long (6 bytes)
- Unique for each network interface card made
(hopefully)
29Ethernet Addressing
- This computer MAC 00-02-2D-6D-CD-9B (base 16)
- In binary 00000000-00000010-00101101-01101101-110
01101-10011011
30Ethernet Frames
- Ethernet divides data to be transmitted into
frames - Ethernet frame has six parts
- Preamble (8 bytes)
- Destination MAC address (6 bytes)
- Source MAC address (6 bytes)
- Type or length (2 bytes)
- Data (64 1500 bytes) (usually)
- FCS (4 bytes)
3110Base2, 10Base5
- Good news - no devices needed to control traffic
on the network - Bad news no devices available to control
traffic on the network
32Ethernet (Star Topology)
- 10BaseT, 100BaseT(X), 1000BaseT, 1000BaseSX,
1000BaseLX - Require a device at center of star
- Ethernet hub or Ethernet switch
33Ethernet Hubs and Switches
- Hub any frames transmitted by a connected
computer are sent out all ports (to all connected
computers) - Switch learns which computers are connected,
what port they are connected to, and only
transmits frames out the port that the specific
receiving computer is connected to
34Hubs, Switches, Collisions
- Consider a 4-node 10Base2 network, a 4-node
10BaseT network with a hub, and a 4-node 10BaseT
network with a switch - Which network will have the most collisions?
the least?
35Hubs, Switches, Collisions
- A network with a hub is a single collision domain
(bad!) - A network with a switch has a separate collision
domain for each port (good!)
36Ethernet Hubs and Switches
- Hubs single collision domain, single broadcast
domain - Switches multiple collision domains, single
broadcast domain - Hubs and switches can be used together in a
network
37Ethernet Broadcasts
- A broadcast frame has destination address of
FF-FF-FF-FF-FF-FF (binary all 1s) - A switch will send broadcast frames out every
port (except the one on which the frame was
received)
38Ethernet Broadcasts
- Broadcasts are sometimes necessary
- Broadcasts are sometimes evil
39Broadcast Domains
- Example Consider an Ethernet network with an
8-port switch fully connected How many
broadcasts domains are in this network? How many
collision domains are in this network?
40How Does A Switch Work?
- It records the source MAC address in every frame
it receives and stores it in the filter table
with the associated port from which it came - If a switch receives a frame destined for a MAC
address that is not in the filter table, the
switch will send it out every port
41Real World Show and Tell
- HP Procurve 2848 switch
- Can mix Ethernet standards on one device
- 1000Base-LX or 1000Base-SX
- 1000Base-T/100Base-T/10Base-T autosensing
42Thats a Wrap on Ethernet(for now)
- Other LAN technologies
- FDDI (Fiber Distributed Data Interface)
- Token Ring
- LocalTalk (Apple)
43Remember This?(Lets refine it)
Transmission medium
44Network Layers OSI Model(Open Systems
Interconnection)
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
45Why All the Layers?
- Provides a model for how communication should
take place - Real world example organization chart in a
business (president, VP, mid-managers,
low-managers, entry-level staff)
46Why All the Layers?
- Software developers only have to be concerned
with a particular layers functions - Allows many companies (vendors) to develop
software that will work together - Allows various types of network hardware and
software to communicate - Changes in one layer dont cause problems in
other layers
47Role of Each Layer in OSI Model
- Application Layer provides an interface between
the application software (e.g. Internet Explorer,
AIM) and the lower network layers - Presentation Layer translates data to standard
format provides encryption and data compression
48Role of Each Layer in OSI Model
- Session Layer directs traffic
- (will not be emphasized just know that it
exists and where)
49Role of Each Layer in OSI Model
- Transport Layer
- takes streams of data from application software
and upper layers - converts data stream into segments
- opens communication with receiving computer
- Provides either reliable or unreliable
communication to receiving computer
50Role of Each Layer in OSI Model
- Network Layer
- Manages network addresses
- Responsible for transporting data to other
computers which may not be attached to the local
area network - Takes segments from transport layer
- Sends datagrams (or packets) to data link layer
51Role of Each Layer in OSI Model
- Data Link and Physical Layers
- This is where Ethernet exists
- Data link layer takes datagrams from network
layer and builds frames
Preamble (8 bytes)
Data (64 up to 1500 bytes)
Destination MAC Address (6 bytes)
Source MAC Address (6 bytes)
Length (2 bytes)
FCS (4 bytes)
52Data Encapsulation Through Layers
- Information from layer above is encapsulated (has
a header and error detection information added) - Corresponding layer on receiving computer uses
and then removes the header and error detection
data (if any) - More on this later
53TCP/IP
- Transport and Network Layers Protocols
- TCP Transmission Control Protocol
- Operates at the transport layer (layer 4)
- IP Internet Protocol
- Operates at the network layer (layer 3)
54TCP/IP
- Developed by Department of Defense in 1960s
- Wanted to connect mainframe and supercomputers in
different parts of the country
55TCP/IP
- Wanted the network to not have a single point of
failure - End node verification
- Dynamic routing
56TCP/IP
- This network was called ARPAnet (Advanced
Research Projects Agency) - NSF took the design and used it to connect
research centers and universities - NSFs network became known as the Internet (Al
Gore??)
57Features of TCP/IP
- Logical addressing
- Ethernet cant get us very far!
- Routing (new network device for us!)
- Routers connect networks together
- Data addressed to the local network doesnt go
through the router
58IP Addresses
- 32 bit (4 bytes)
- Usually displayed in base 10 notation
- Example 12.146.244.182
- Unique to each computer (but user controllable)
59IP Addresses
- Network portion
- Host (or computer portion)
- Telephone number analogy
- Subnet mask (netmask) determines boundary
60Example IP Address
- Example IP Address 206.74.226.4
- binary (base 2) equivalent 11001110.01001010.11
100010.00000100 - Netmask 255.255.255.0
- binary equivalent 11111111.11111111.11111111.00
000000 - - The 1s (the on bits) indicate the network
portion, the 0s represent the host (or
computer) portion
61IP Address - Network
- An address with all zeros in host portion is
generally referred to as the network address. - Example
- 206.74.226.0
- 11001110.01001010.11100010.00000000
-
62IP Address - Broadcast
- An address with all ones in host portion is the
broadcast address. - Example
- 206.74.226.255
- 11001110.01001010.11100010.11111111
-
63A Rule or Two
- A host cannot have the network address.
- A host cannot have the broadcast address.
- (Basically, an IP address assigned to a host
cant have all ones or all zeros in the host
portion of the address.) - 127.0.0.1 is reserved.
64IP Addresses
- Three main classes of IP addresses
- Class A
- Class B
- Class C
65IP Addresses Class A
- Class A
- Intended for the networks with very large number
of nodes - First byte of address (first octet) is network
portion (i.e. netmask 255.0.0.0) - First bit of first byte of address must be 0
(binary) - What is the range of network addresses?
- How many networks?
- How many hosts?
66IP Addresses - Class B
- Class B
- Intended medium-sized networks
- First two bits of first byte of address must be
10 (binary) - First two bytes of address (first two octets) are
network portion (i.e. netmask 255.255.0.0) - What is the range of network addresses?
- How many networks?
- How many hosts?
67IP Addresses - Class C
- Class C
- Intended for smaller networks
- First three bits of first byte of address must be
110 (binary) - First three bytes of address (first three octets)
are network portion (i.e. netmask
255.255.255.0) - What is the range of network addresses?
- How many networks?
- How many hosts?
68IP Address Classes - Summary
- Class A
- Network address range
- 0.x.x.x 126.x.x.x (127 class A addresses)
- Netmask 255.0.0.0
- Class B
- Network address range
- 128.0.x.x 191.255.x.x (16384 class B addresses)
- Netmask 255.255.0.0
- Class C
- Network address range
- 192.0.0.x 223.255.255.x (2,097,152 class C
addresses) - Netmask 255.255.255.0
69IP Addresses (Class D and E)
- They exist
- Not commonly used
- We will not study them
70Why Is the Netmask Needed?
- If we can look at the first octet in the address
and tell which class the address is in, why do we
need to specify the netmask? - Answer The netmask can be varied to allow
subnetting, more later
71Review the Big Picture
- Application software
- Network layers (OSI model)
- Application, Presentation, Session -gt upper
layers - Transport layer (TCP is the transport layer
protocol we are studying) - Network layer protocol (IP)
- Data Link and Physical layers (Ethernet)
72Review the Big Picture
- Upper layers produce data stream
- TCP (transport layer protocol)
- takes data
- produces segments
- sends segments to network layer protocol
- IP (network layer protocol takes segments)
- Constructs a packet
- puts segment into data field in packet
- adds IP header (with source and destination IP
addresses and other info) - sends packet down to data link layer
- Ethernet (data link layer)
- Constructs a frame
- puts IP Packet into data field in frame
- adds header and FCS fields to frame
- sends frame to physical layer (network interface
card) - Physical layer sends the frame onto the medium
(the wire) as series of bits in the form of
electrical signals
73IP Packet (a.k.a. IP datagram)
- Version
- IP version number
- 4 bits
- Header length
- 4 bits
- Priority and type of service
- 8 bits
- Total length
- Length of header and data combined (entire
packet) - 16 bits
- Indentifier
- Like a serial number for the packet
- 16 bits
74IP Packet
- Flags
- Indicates fragmentation
- 3 bits
- Fragmentation
- If packet is too large for frame, provides info
to help reassemble packet on other end - 13 bits
- Time To Live
- Expiration time
- 8 bits
- Protocol
- Transport layer info (port number and protocol)
- 8 bits
- Header checksum
- For error detection within IP packet
- 16 bits
75IP Packet
- Source IP address
- 32 bits (of course!)
- Destination IP address
- 32 bits
- Options
- Used for testing, debugging, etc.
- 0 bits or 32 bits
- Data
- The payload - contains the data from/to the
transport layer (usually the TCP segment) - Varies in length
76IP Packet
- Most important things to remember
- Contains source and destination IP addresses
- Contains TCP port info
- Contains data
77Examining Incoming Data
- Examine FCS field in frame
- Examine destination MAC address in frame
- Examine header checksum in IP packet
- Examine destination IP address in packet
- If all these pass
- Send data (TCP segment) to TCP for further
processing
78Subnetting Example
- Suppose you have a small office network with only
5 computers/network devices (5 hosts). Assigning
a class C license to you organization would be
wasteful of the precious IP addresses.
79Subnet Example
- Your ISP could assign you an network IP address
like this - Network address 220.178.12.144
- Binary 11011100.10110010.00001100.10010000
- Netmask 255.255.255.240
- Binary 11111111.11111111.11111111.11110000
- Broadcast 220.178.12.?
- Binary ?
- How many hosts can be on this IP subnet?
80What good is IP subnetting?
- Conserves addresses
- Allows a large network to be broken up into
smaller networks to increase efficiency - Reduce the broadcasts that hosts receive
- Problems can be contained (broadcast storms)
- Allow network bandwidth to be controlled
81How do we subnet?
- Router
- Connected to two or more subnetworks
- Forwards packets based on destination IP address
- Each network interface on a router will have an
IP address assigned to it that is part of the IP
subnet
82Review Switching, Broadcasts, Collisions
- Hubs repeat everything
- Switches forward frames based on destination MAC
(Ethernet) address - Switches always forward broadcasts
- Every switch port is a collision domain
83Back to Routing
- Routers
- Do NOT forward Ethernet broadcasts
- Do forward IP packets based on destination IP
address - Forward a packet to the network in which the
destination IP address resides
84Routing Example 1
- Consider Computer A and Computer B directly
connected via Ethernet cable (Wow, you can do
that?) - Computer A sends data to Computer B
- What happens?
85Back to Routing Example 1 (contd)
- Computer A 220.178.12.42
- Computer B 220.178.12.43
- The netmask is 255.255.255.0
- (Remember all hosts on a common subnet must have
a common netmask and network address!) - What is the network address for this small
network?
86Back to Routing Example 1 (contd)
- In Computer A
- Data comes from app s/w and upper layers
- TCP creates a segment, passes down to IP
- IP builds packet with destination IP address,
source IP address, data (TCP segment), and other
header fields - IP determines if the destination IP address is on
the same subnet as the source IP address (why?
more on this in routing example 2) - IP passes packet down to data link layer for
frame creation but wait!
87Back to Routing Example 1 (contd)
- The Ethernet frame must have a destination MAC
address, right? - No data can be passed from A to B on an Ethernet
network without a destination MAC address - What gives??
88Address Resolution Protocol (ARP) to the rescue
- If IP has a packet to send, it must inform the
data link layer (Ethernet) of the destination MAC
address - ARP serves as IPs detective
- IP uses ARP to find the MAC address that
corresponds to a particular IP address
89Address Resolution Protocol (ARP)
- ARP sends out an Ethernet broadcast frame
(destination address is all 1 in binary or all
FF in hexadecimal) - The broadcast frame basically asks, Would the
host with this IP address please respond to me
with your MAC address? - All hosts on the subnet will process the frame
only the particular host with the destination IP
address will respond
90Back to Routing Example 1 (contd)
- After ARPing for the MAC address, IP sends the
packet down to the data link layer along with the
destination MAC address - Data link layer builds the frame
- Passes to physical layer for transmission as
series of bits yada yada yada
91 92Routing Example 2
- Router in between Computer A and Computer B
- 220.178.12.0, netmask 255.255.255.0
- 220.178.13.0, netmask 255.255.255.0
- Assume router interfaces have following IP
addresses/netmasks - E0 220.178.12.1 / 255.255.255.0
- E1 220.178.13.1 / 255.255.255.0
93Routing Example 2 (contd)
- Computer A sending data to Computer B
- Computer A
- IP address 220.178.12.34
- Netmask 255.255.255.0
- Computer B
- IP address 220.178.13.147
- Netmask 255.255.255.0
- Question What are the network and broadcast
addresses for the two subnets in this example?
94Routing Example 2 (contd)
- In Computer A
- Data comes from app s/w and upper layers
- TCP creates a segment, passes it down to IP
- IP builds packet with destination IP address,
source IP address, data (TCP segment), and other
header fields - IP determines if the destination IP address is on
the same subnet as the source IP address - If destination is on the same subnet, then ARP
for the MAC address of computer with destination
IP address
95Routing Example 2 (contd)
- But wait! In this example, Computer B is NOT on
the same subnet with Computer A - Will ARP work? Remember that the router does
not forward Ethernet broadcasts and ARP uses an
Ethernet broadcast
96Routing Example 2 (contd)
- Computer A must know IP address of default
gateway for its subnet - The default gateway is the IP address of the
router interface on that subnet
97Routing Example 2 (contd)
- Computer A
- ARPs for the MAC address of the default gateway
(the router) - Router responds with MAC address for its Ethernet
interface on that subnet (E0) - Computer A sends Ethernet frame to router
(containing the IP packet with the original
source and destination address)
98Routing Example 2 (contd)
- Router
- Sees the frame is for him
- The routers data link layer passes the IP packet
up - The IP layer on the router examines the IP
destination address - The router sees that the destination is on the
same subnet with interface E1 - ARPs for MAC address of destination computer
(Computer B) Computer B responds - Router builds a frame with recipients real MAC
address as destination and original IP packet
payload - Sends the frame down to physical layer for
transmission
99IP Addressing/Subnetting Review
- Example
- IP Network Address 196.24.44.80
- Subnet Mask (netmask) 255.255.255.248
- What is the range of host addresses?
- What is the broadcast address?
100IP Addressing/Subnetting Review
- Network Address
- 11000100.00011000.00101100.01010000
- Netmask
- 11111111.11111111.11111111.11111000
- Broadcast
- 11000100.00011000.00101100.01010111
- First host is network address 1
- 11000100.00011000.00101100.01010001
- Last host is broadcast 1
- 11000100.00011000.00101100.01010110
101IP Addressing/Subnetting Review
- First host is network address 1
- 11000100.00011000.00101100.01010001
- 196.24.44.81
- Last host is broadcast 1
- 11000100.00011000.00101100.01010110
- 196.24.44.86
- Range of host addresses on this subnet
- 196.24.44.81 -gt 196.24.44.86
102Routing Example 3
E0 206.113.116.169
C
Router A
Switch
E2 221.19.10.1
E1 220.178.13.2
E0 220178.13.1
B
Router B
A
Switch
Switch
E2 220.178.17.161
E1 220.178.12.145
103Routing Example 3 (contd)
- Computer A to send IP packet to Computer C
104Routing Example 3 (contd)
- Computer A
- ARPs for the MAC address of the default gateway
(router A) - Router A responds with MAC address for its
Ethernet interface on that subnet (E1) - Computer A sends Ethernet frame to router A
(containing the IP packet with the original
source and destination address)
105Routing Example 3 (contd)
- Router A
- Sees that the frame is for him (destination MAC
address) - The routers data link layer passes the IP packet
up - The IP layer on the router examines the IP
destination address - The router sees that the destination is NOT on
any subnet to which he is connected - Router A discards (drops) the packet
- The End
106Routing Example 3 (contd)
- How can this be made to work?
- Solution 1 Configure a default route on router
A - Similar to default gateway on computers
- Default route is the IP address on a local subnet
to which all packets destined for foreign IP
addresses are forwarded
107Routing Example 3 (contd)
- Router A would have in its configuration
- gt Default route 220.178.13.2
- (The IP address for E1 on router B)
108Routing Example 3 (contd)
- Now, what will router A do?
- Sees that the frame is for him (destination MAC
address) - The routers data link layer passes the IP packet
up - The IP layer on the router examines the IP
destination address - The router sees that the destination is NOT on
any subnet to which he is connected - Router A ARPs for MAC address corresponding to
default route (gateway) address - Gets a reply, sends frame to E1 on router B
109Routing Example 3 (contd)
- Router B
- Sees that the frame is for him
- Unpacks the frame and sends data up to IP
- IP sees that the destination IP address is on the
same subnet with interface E2 - ARPs for MAC address of destination computer
(Computer B) Computer B responds - Router builds a frame with recipients real MAC
address as destination and original IP packet
payload - Sends the frame down to physical layer for
transmission
110Routing Example 3 (contd)
- Solution 2 Configure a static route on router A
- Simply tells router A to send all packets
destined for a particular foreign network to a
specific local IP address - In this example, configure router A with
following command - gt 221.19.10.0 via 220.178.13.2
111Routing Example 3 (contd)
- What routing configuration does router A need to
allow hosts full access to LAN hosts and the
Internet? - What about router B?
112IP Routing Summary
- Default routing the IP address on a local
subnet to which all packets destined for foreign
IP addresses are forwarded - Static routing IP addresses on a local subnet
to which all packets destined for particular
foreign IP addresses are forwarded
113IP Routing Summary
- Routing information in a router is contained in
the routing table - Example of a routing table
- 192.168.50.0 255.255.255.0 connected to E0
- 192.168.51.0 255.255.255.0 connected to E1
- 192.168.40.0 255.255.255.0 via 192.168.50.1
- 192.168.30.0 255.255.255.0 via 192.168.51.1
- 0.0.0.0 via 192.168.51.1
114Dynamic Routing
- Routers educate each other about networks to
which they are connected - A protocol for exchanging route information among
routers is called a routing protocol
115Dynamic Routing
- The most famous routing protocol in use is called
Routing Information Protocol (RIP, very
creative, huh?) - In RIP, a router will report all of the networks
to which it is connected and also the number of
hops (or routers) between it and the particular
networks - Also propagates RIP info it has received
116Dynamic Routing
- Upon receipt of RIP info from a neighboring
router, all hop counts are incremented by 1 and
the info is placed into the routing table
117Dynamic Routing
- Example 3 routers (next slide)
118Dynamic Routing Example (RIP)
E0 17.14.210.32
E0 206.79.211.44
E1 177.100.48.2
E1 192.168.21.32
A
E3 192.168.21.33
E1 177.100.48.3
B
C
E2 12.34.25.147
E2 186.18.90.97
(assume all netmasks are 255.255.255.0)
119Dynamic Routing Example (RIP)
- Router A reports to router B
Network Hops
17.14.210.0 0
12.34.25.0 0
120Dynamic Routing Example (RIP)
- Why is the hop count important?
- A router might receive route information for a
particular network from two directions - When this happens, the router will only keep the
route with the smallest hop count (closest path
to the network)
121Dynamic Routing Example (RIP)
- Router B will add these entries in routing table
- 17.12.210.0 via 192.168.21.32
- 12.34.25.0 via 192.168.21.32
122Dynamic Routing Example (RIP)
- Router B reports to router C
Network Hops
17.14.210.0 1
12.34.25.0 1
206.79.211.0 0
192.168.21.0 0
186.18.90.97 0
- What will router C add to its routing table?
123Dynamic Routing
- RIP is being gradually being replaced by newer
more efficient routing protocols - Open Shortest Path First (OSPF) is becoming
prevalent
124Layers Again
- Upper layers (s/w application) -gt Transport Layer
- Transport -gt Network -gt Data Link -gt Physical
- Layers talk to their counterparts
- At what layers do routers operate?
- How does the requirement for end node
verification fit in?
125Layers Again
- Transport layer is the first layer in which the
end nodes really talk to each other - Transport layer is where end node verification
takes place
126Transport Layer (Layer 4)
- An interface for network applications provides
a way for application software to access the
network. The designers wanted a way to send data
not just to a particular computer, but to a
particular network application running on the
destination computer
127Transport Layer (Layer 4)
- Provide multiplexing/demultiplexing the
transport layer must be capable of simultaneously
supporting several network applications and
directing data to the network layer - Provide mechanism for one network application to
maintain connections with more than one computer
128Transport Layer (Layer 4)
- Error checking
- Similar to network and data link layer error
checking (nobody dont trust nobody) - Flow control
- One computer doesnt allow the other computer to
overwhelm it with data - Verification
- Making sure all the data got delivered
129Transport Layer (Layer 4)
- Two transport layer protocols
- Transport Control Protocol (TCP)
- provides extensive error checking and flow
control to ensure successful delivery of data - It is connection-oriented
- User Datagram Protocol (UDP)
- Provides very basic error checking
- Reliability sacrificed for speed and efficiency
- It is connectionless
130Transport Layer (Layer 4)
- Oversimplified example two humans in
connection-oriented conversation - Bill Hello Larry. Are you listening? I have
something to say. - Larry Yes, Im listening Bill.
- Bill There is
- Larry Yes, I understand.
- Bill a baseball game
- Larry Yes, I understand.
- Bill on Saturday.
- Larry Yes, I understand.
- Bill Thats all I have to say.
- Larry Ok, Ill stop listening to you.
- Bill Ok, Ill stop talking to you.
131Transport Layer (Layer 4)
- Oversimplified example two humans in
connectionless conversation - Bill Larry, there is a baseball game on Saturday.
132TCP and UDP Ports
- Network software applications access the
transport layer protocols through a port - Ports are numbered only one software
application can use one port number at a time - The ports are not real, hardware ports they are
software ports
133TCP Port Example
- Example Computer A wants to download a web page
from computer B - Computer Bs web server software is accepting
connections on TCP port 80 - Computer A will pick an unused port number at
random and open a connection to computer B on its
port 80
134TCP Port Example
Computer B (web server)
Web server software
Network Layer (IP)
Data Link Layer (Ethernet)
Computer A
135TCP Port Example
- The web server software on B has notified TCP
that it wishes to accept connections on port 80
(passive mode) - The browser software on computer A then asks TCP
(on computer A) to open a connection to port 80
on computer B - Computer A will use a random port number not in
use already
136TCP Port Example
Computer B (web server)
137Well Known TCP Ports
- 20, 21 FTP
- File Transfer Protocol
- 23 Telnet
- Terminal emulation interface
- 25 SMTP
- Simple Mail Transfer Protocol
- 53 DNS
- Domain Name Service
- 80 HTTP
- Hypertext Transfer Protocol (the web)
- 110 POP3
- Post Office Protocol (checking email)
138TCP Segment
- Source port (16 bits)
- Port number used by transmitting host (max 65534)
- Destination port (16 bits)
- Port number used by receiving host (max 65534)
- Sequence number (32 bits)
- Number corresponding to first byte of data it
will send - Acknowledgement number (32 bits)
- The next sequence number that the receiver is
expecting - Data offset (4 bits)
- Length of the header (integer multiple of 32 bits)
139TCP Segment
- Reserved (6 bits)
- All zeroes, all the time
- Control flags (1 bit each)
- URG
- ACK
- PSH
- RST
- SYN
- FIN
140TCP Segment
- Window (16 bits)
- The next sequence number that the transmitting
computer is free to send without further
acknowledgement - Checksum (16 bits)
- Error correction (similar to lower layers)
- Urgent pointer (16 bits)
- Basically, a sequence number at which some urgent
data will begin - Options (variable length)
- Usually either 0 bits or 32 bits
- Padding (variable)
- Extra zero bits to make sure the header is
integer multiple of 32 bits - Data (variable length)
141TCP Segment Most Important Fields
- Source port
- Destination port
- Sequence number
- Acknowledgement number
- Window
- Data
142Establishing a TCP Connection(Three-Way
Handshake)
- From previous example
- 1) Computer A sends a segment to computer B
requesting synchronization basically a
request to open a connection (session) - This segment also contains As initial sequence
number - 2) Computer B sends a segment back that
acknowledges the synchronization and contains
its initial sequence number
143Establishing a TCP Connection(Three-Way
Handshake)(contd)
- 3) Computer A acknowledges receipt of computer
Bs initial sequence number
144TCP Flow Control
- The receiving computer, in order to prevent the
transmitting computer from overwhelming it with
data, uses the Window field is used to define how
many bytes of data the transmitting computer can
send before an acknowledgement
145TCP Flow Control (illustration)(A sending data
to B)
B
A
TCP Segments
3 bytes of data (1,2,3)
Acknowledge 4, window 5
5 bytes of data (4,5,6,7,8)
Acknowledge 6, window 2
2 bytes of data (6,7)
146TCP Flow Control
- Its possible that segments will arrive at the
receiving computer in the wrong order (order
different than transmitted) - This may be due to a router going down and the
route between the two computers being changed
(dynamic routing) - TCP can put segments back in the correct order
before giving data to application software
147UDP Flow Control (?)
A
B
8 bytes of data (1-8)
148UDP Datagram
- Source port (16 bits)
- Port number used by transmitting host (max 65534)
- Destination port (16 bits)
- Port number used by receiving host (max 65534)
- Length (16 bits)
- Length of the entire datagram
- Checksum (16 bits)
- Error detection
- Data (varies)
149Firewalls
- Definition Hardware and/or software designed to
a provide security for a network or a particular
computer - Can control access based on
- network layer (layer 3)
- transport layer (layer 4)
- Application s/w
150Typical Firewall Configuration(as a standalone
network device)
- Two network interfaces
- Inside interface (trusted)
- Usually connected to internal corporate/office/cam
pus network - Outside interface (not trusted)
- Usually connected to Internet (via Internet
service provider
151Typical Firewall Configuration
- Hosts on the network on the inside interface
usually have unrestricted ability to open TCP
connections (and send UDP datagrams) to hosts on
outside - Exceptions can occur
- Disallow access to certain web sites
- Disallow email to be sent through external mail
servers (virus/worm control)
152Typical Firewall Configuration
- Hosts on the outside interface (the rest of the
Internet) usually have no ability to open TCP
connections or send un-requested UDP datagrams to
hosts on inside network - Exceptions
- Allow external hosts to access a web server on
port 80 (HTTP port) - Allow external hosts access to a mail server on
port 25 (SMTP) for delivering email
153Typical Firewall Configuration (NAT)
- Most firewalls capable of Network Address
Translation (NAT) - Allows for a private IP addressing scheme on the
inside network - When inside hosts need to communicate with hosts
outside, the firewall translates the inside
(private) IP address to a real IP in outgoing IP
packets
154Typical Firewall Configuration (NAT)
- For an IP packet coming back from an outside
host, the firewall will translate the destination
IP address back to the particular hosts private
(inside) address - When the session is over, the outside IP address
can be recycled to be used for another inside
host
155Typical Firewall Configuration (NAT)
- Advantage can allow a large number of hosts on
inside network to share a relatively small number
of real IP addresses for Internet use - Very important for home networks with more than
one computer (together with PATmore later)
156Typical Firewall Configuration (NAT)
- Network address translations can be static so
that an inside host will always have a particular
outside (real) IP address - This is necessary for web servers, email servers,
DNS servers, or any computer that may need to
allow incoming connection requests