Computer Science 302 Presentation bUSINESS DATA AND COMMUNICATION

profileAlan7
ch05.pptx

Chapter 5

Network and Transport Layers

Business Data Communications & Networking

FitzGerald ● Dennis ● Durcikova

Prepared by Taylor M. Wells: College of Business Administration, California State University, Sacramento

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Outline

Transport Layer Protocols

Network Layer Protocols

Transport Layer Functions

Linking to the application layer

Segmenting

Session Management

Network Layer Functions

Addressing

Routing

TCP/IP Examples

Implications for Management

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Introduction

Transport and Network layers

Responsible for moving messages

from end-to-end in a network

Closely tied together

TCP/IP: most commonly used protocol

Used in Internet

Compatible with a variety of Application Layer protocols as well as with many Data Link Layer protocols

Network Layer

Data Link Layer

Application Layer

Transport Layer

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

3

Network and Transport Layers

Transport Layer

Layer 4 in the Internet model

Links application and network layers

Responsible for segmentation and reassembly

Session management

Responsible for end-to-end delivery of messages

Network Layer

Layer 3 in the Internet model

Responsible for addressing and routing of messages

Internet Model

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Transport

Network

Data Link

Physical

Application

Introduction - Transport layer

Responsible for end-to-end delivery of messages

Responsible for segmentation and reassembly

Breaking the message into several smaller pieces at the sending end

Reconstructing the original message into a single whole at the receiving end

Interacts with Application Layer

Transport Layer

Application Layer

Network Layer

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

5

Introduction – Network Layer

Responsible for addressing and routing of messages

Selects the best path from computer to computer

until the message reaches destination

Performs encapsulation on sending end

Adds network layer header to message segments

Performs de-capsulation on receiving end

Removes the network layer header at receiving end and passes them up to the transport layer

Network Layer

Transport Layer

Data Link Layer

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

6

Transport/Network Layer Protocols

TCP/IP (Transmission Control Protocol / Internet Protocol)

Most common, used by all Internet equipment

IPX/SPX

Similar to TCP/IP

Mainly used by Novell networks (Novell has since replaced it with TCP/IP)

X.25

Used mainly in Europe

SNA (System Network Architecture)

IBM’s protocol suite

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

7

TCP/IP Protocol

Developed in ‘74 by V. Cerf and B. Kahn

As part of Arpanet (U.S. Department of Defense)

Most common protocol suite

Used by the Internet.

Almost 70% of all backbone, metropolitan, and wide area networks use TCP/IP

Most common protocol on LANs (surpassed IPX/SPX in ‘98)

Reasonably efficient and error free transmission

Performs error checking

Transmits large files with end-to-end delivery assurance

Compatible with a variety of data link layer protocols

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Transport Layer Protocols

Transmission Control Protocol (TCP)

Most common transport layer protocol

PDU called a segment

Breaking up a large message into smaller packets

Numbering the packets and

Reassembling them at the destination end

Used for reliable transmission of data

160 - 192 bits (20 -24 bytes) of overhead

Options field is not required

Destination Port

(16 bits)

Unused

(6 bits)

Source Port

(16 bits)

Sequence Number

(32 bits)

ACK number

(32 bits)

Header Length

(4 bits)

Flags

(6 bits)

Flow Control

(16 bits)

CRC-16

(16 bits)

Urgent Pointer

(16 bits)

Options

(32 bits)

User Data

(varies)

The header length field is used to tell the receiver how long the TCP packet is

used in message reassembly

how much data it can accept and then wait for further instructions

mark a segment of data as 'urgent'

TCP Header: 192 bits (24 bytes)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

9

Transport Layer Protocols

User Datagram Protocol (UDP)

Operates at the transport layer

 Used when the sender needs to send a single small packet to the receiver

No need to worry about segmenting or reassembling

Faster transmission

PDU called a segment

Used in time-sensitive situations, for control messages, or when reliability is handled by the application layer

32-64 bits (4-8 bytes) of overhead

Source port is optional in IPv4 and IPv6, Checksum is optional in IPv4

Destination Port

(16 bits)

Source Port

(16 bits)

Length

(16 bits)

Checksum

(16 bits)

User Data

(varies)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

10

Network Layer Protocols

Internet Protocol (IP)

Responsible for addressing and routing of packets

IP version 4 (IPv4)

Most common version of IP used

a 192 bit (24 byte) header, uses 32 bit addresses

32-bit addresses (232 or ~4.29 billion possible)

Exhaustion of address space

IP version 6 (IPv6)

Mainly developed to increase IP address space due to the huge growth in Internet usage (128 bit addresses)

128-bit addresses (2128 or ~3.4 × 1038 possible)

Slowly being adopted due to IPv4 exhaustion

Both versions have a variable length data field

Max size depends on the data link layer protocol.

e.g., Ethernet’s max message size is 1,492 bytes, so max size of TCP message field:

1492 – 24 – 24 = 1444 bytes

TCP header

IPv4 header

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

11

Network Protocols

IPv4 Packet

160-192 bits (20-24 bytes) of overhead

Options field rarely used

Header length

(4 bits)

Packet Offset

(13 bits)

Version number

(4 bits)

Type of service

(8 bits)

Total length

(16 bits)

IDs

(16 bits)

Flags

(3 bits)

Time to Live /

Hop Limit

(8 bits)

CRC-16

(16 bits)

Protocol

(8 bits)

Options

(32 bits)

User Data

(varies)

Source Address

(32 bits)

Destination Address

(32 bits)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

12

Network Protocols

IPv6 Packet

Fixed Header

320 bits (40 bytes) of overhead

Traffic Class / Priority

(8 bits)

Version number

(4 bits)

Flow Label

(20 bits)

Payload length

(16 bits)

Next Header

(8 bits)

Hop Limit

(8 bits)

User Data

(varies)

Source Address

(128 bits)

Destination Address

(128 bits)

Optional Headers

Optional Headers

Hop-by hop options

Destination options (with routing options)

Routing

Fragment

Authentication

Encapsulation Security Payload

Destination options

Mobility

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

13

Transport Layer Functions

Linking to Application Layer

Packetization and Reassembly

Establishing connection (virtual)

Connection Oriented

Connectionless

Quality of Service (QoS)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

14

Linking to Application Layer

TCP may serve several Application Layer protocols at the same time

Problem: Which application layer program to send a message to?

Solution: Port numbers located in TCP header fields; 2-byte each (source, destination)

Standard port numbers

Usual practice

Nonstandard port numbers

Possible, but requires configuration of TCP

TCP

HTTP

FTP

SMTP

80

21

25

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

15

Transport Layer Functions

Linking to the application layer

TCP/UDP may serve multiple application layer protocols

Ports used to identify application (2-byte numbers)

Many source/destination ports follow standards

Common port standards

HTTP: TCP port 80

HTTPS: TCP port 443

FTP: TCP ports 20 and 21

SMTP: TCP port 25

IMAP: TCP port 143

POP3: TCP port 110 (more commonly TCP port 995 secure version)

DNS: TCP or UDP port 53 (most commonly UDP)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

16

Transport Layer Functions

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

17

Transport Layer Functions

Segmenting

Breaking up large files into smaller segments (and putting them back together)

Segments may be passed individually to application layer or after reassembly

How large are the segments?

Size depends on the network and data link layer protocols

Maximum Segment Size (MSS) is negotiated during TCP handshake

e.g., if the maximum size of the data in an Ethernet frame is 1,500 bytes and TCP and IP use 20 byte headers, the maximum segment size is 1460 bytes

TCP header

IPv4 header

Ethernet Frame Data Size

1500 – 20 – 20 = 1460 bytes

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

18

Sender PDU Receiver
Application Packet
Transport Segment
Network Packet
Data Link Frame

Transport Layer Functions

Application layer sees message as a single block of data

Breaks a large message into smaller pieces (packetization)

Puts them back together at the destination (reassembly)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

19

Transport Layer Functions

Session management

A session can be thought of as a conversation between two computers or creating a virtual circuit

Using a session to send data is also called connection-oriented messaging (TCP)

Sending messages without establishing a session is connectionless messaging (UDP)

TCP connections are opened using a three-way handshake

SYN

SYN-ACK

ACK

Sessions provide reliable end-to-end connections

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

20

Setting up Virtual Connections

A

B

SYN

SYN

ACK 2

not busy

Data 1

Data 2

Data 3

Data 4

FIN

Requests a virtual circuit (TCP connection) and negotiates packet size with B

Sends data packets one by one (in order) using continuous ARQ (sliding window)

Closes virtual circuit

In continuous ARQ, the sender and receiver usually agree on the size of the sliding window.

The maximum number of packets permitted in the sliding window, it cannot send any more packets until the receiver sends an ACK

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

21

Routing Implied by Transport Layer

Connection Oriented (provided by TCP)

Setting up a virtual circuit (a TCP connection)

TCP asks IP to route all packets in a message by using the same path (from source to destination)

Packet deliveries are acknowledged

Used by HTTP, SMTP, FTP

Connectionless Routing (provided by UDP)

Sending packets individually without a virtual circuit

Each packet is sent independently of one another (routed separately and can follow different routes and arrive at different times)

QoS Routing (provided by RTP (Real-Time Transport Protocol))

A special kind connection oriented routing with priorities

E.g.  videoconferencing requires fast delivery of packets to ensure that the images and voices appear smooth and continuous

RTP is combined with UDP- each real-time packet is first created using RTP and then surrounded by a UDP datagram

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

22

Network Layer Functions

Addressing

Used to direct messages from source to destination

Addresses are assigned in various ways (e.g., by system administrators, ICANN, hardware vendors, etc.)

Addresses exist at different layers

Addresses may be translated (resolved) from one layer to another (e.g., DNS, ARP)

Address Type Example Example Address
Application layer Uniform Resource Locator (URL) www.indiana.edu
Network layer IP address 129.79.78.193 (4 bytes)
Data link layer MAC address 1C-6F-65-F8-33-8A (6 bytes)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

23

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Network Layer Functions

Addressing

IPv4 addresses are 32 bits

Most common way to write is using dot-decimal notation

Easier for people to read and remember

Breaks the address into four bytes and writes each byte in decimal notation instead of binary

Example: 129.79.78.193

10000001

01001111

01001110

11000001

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Network Layer Functions

Addressing

A portion of an IP address represents the network and the rest identifies the host

Classful addressing

Uses the first bits to determine number of hosts

Discontinued, but nomenclature still used

Classless Inter-Domain Routing (CIDR)

Uses subnet masks to more flexibly divide address space into subnets

IP address: 129.79.78.193

Subnet Mask: 255.255.255.0

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Network Layer Functions

Dynamic addressing

Configuring each device manually is time consuming

Assigning addresses permanently can be inefficient when devices are not connected to network

A server can supply IP addresses automatically

Dynamic Host Configuration Protocol (DHCP)

Most common protocol for dynamic addressing

Device sends out broadcast message

DHCP responds with IP settings

Addresses are “leased” for a length of time

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

30

Network Layer Functions

Address resolution

Host (server) name resolution

Translate host name to IP address

e.g., www.indiana.edu → 129.79.78.193

Domain Name Service (DNS)

MAC address resolution

Identify MAC address of the next device in the circuit

Address Resolution Protocol (ARP)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

31

Network Layer Functions

https://root-servers.org/

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Network Layer Functions

Routing

Process of identifying what path to have a packet take through a network from sender to receiver

Routing Tables

Used to make routing decisions

Shows which path to send packets on to reach a given destination

Kept by computers making routing decisions

Routers

Special purpose devices used to handle routing decisions on the Internet

Maintain their own routing tables

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Routing

What are the possible paths from A to G?

ABCG

ABEFCG

ADEFCG

ADEBCG

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

34

10.10.51.x

10.10.52.x

10.10.53.x

10.10.70.x

10.10.34.x

1

2

4

3

1

2

3

1

2

1

2

1

2

4

INTERNET

Simplified Routing Table

Destination Interface
Destination Interface
10.10.70.x 1
0.0.0.0 2

BN 10.10.250.x

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

35

Simplified Routing Table

Destination Interface
Destination Interface
10.10.51.x 1
10.10.52.x 2
10.10.34.x 3
0.0.0.0 4
Destination Interface
10.10.51.x 1
10.10.52.x 2
10.10.34.x 3
10.10.53.x 2
10.10.70.x 2
0.0.0.0 4
Destination Interface
10.10.51.x 1
10.10.52.x 2
10.10.34.x 3
10.10.53.x 2
10.10.70.x 2
10.10.250.34 3
10.10.250.x 2
0.0.0.0 4

10.10.51.x

10.10.52.x

10.10.53.x

10.10.70.x

10.10.34.x

1

2

4

3

1

2

3

1

2

1

2

1

2

4

INTERNET

BN 10.10.250.x

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

36

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Routing

Centralized Routing

Routing decisions made by one computer

Not common anymore

Decentralized Routing

Decisions made by each node independently of one another

Information needs to be exchanged to prepare routing tables

Used by the Internet

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

38

Routing

Static

Fixed routing tables

Manually configured by network managers

Local adjustments when computers added or removed

Dynamic

Routing tables updated periodically

Routers exchange information using protocols to update tables

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

39

Routing

Dynamic routing algorithms

Distance vector: based on the number of “hops” between two devices

Link state: based on the number of hops, circuit speed, and traffic congestion

Provides more reliable, up to date paths to destinations

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

40

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Routing Protocols

Routing Information Protocol (RIP)

Dynamic distance vector protocol used for interior routing

Operation

Network manager builds the routing table

Routing tables broadcast periodically (e.g., every minute or so)

When new computers are added, router counts “hops” and selects the shortest route

Useful in smaller, less complex networks

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

42

Routing Protocols

Open Shortest Path First (OSPF)

Dynamic link state protocol used for interior routing

Most widely used interior routing protocol on large enterprise networks

More reliable paths

Less burdensome to the network because only updates sent

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

43

Routing Protocols

Enhanced Interior Gateway Routing Protocol (EIGRP)

A dynamic link state protocol (developed by Cisco)

Records transmission capacity, delay time, reliability and load for all paths

Keeps the routing tables for its neighbors and uses this information in its routing decisions as well

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

44

Routing Protocols

If each network uses a different protocol internally, how are they able to communicate?

Border Gateway Protocol (BGP)

Dynamic distance vector protocol used for exterior routing

Far more complex than interior routing protocols

Provide routing info only on selected routes (e.g., preferred or best route)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

45

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

46

Multicasting

Unicast - one computer to another computer

Broadcast - one computer to all computers in the network

Multicast - one computer to a group of computers (e.g., videoconference)

Same data needs to reach multiple receivers and avoid transmitting it once for each receiver

Particularly useful if access link has bandwidth limitations

Many implementations at different layers

In IP multicast, hosts dynamically join and leave multicast groups using Internet Group Management Protocol (IGMP)

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

TCP/IP Example

Required network addressing information:

Device’s own IP address

Subnet mask

IP address of default gateway (most commonly the router)

IP address of at least one DNS server

Obtained from a configuration file or DHCP

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

48

Known Addresses, Same Subnet

Suppose we have an HTTP request from Client in building A to Server in building B.

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

49

TCP/IP Examples

A Client (128.192.98.130) requests a Web page from a server (www1.anyorg.com)

Client knows the server’s IP

A Client (128.192.98.130) requests a Web page from a server (www2.anyorg.com) on a different subnet

Client knows the server’s IP

A Client (128.192.98.130) requests a Web page from a server (www1.anyorg.com)

Client does not know server’s IP

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

TCP/IP and Layers

Host Computers

Packets move through all layers

Gateways, Routers

Packet moves from Physical layer to Data Link Layer through the network Layer

At each stop along the way

Ethernet packets is removed and a new one is created for the next node

IP and above packets never change in transit (created by the original sender and destroyed by the final receiver)

Copyright 2011 John Wiley & Sons, Inc

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

52

Implications for Management

Organizations standardizing on TCP/IP

Decreases costs of equipment and training

Network providers are also moving towards standardization

Slow transition to IPv6

Copyright © 2015 John Wiley & Sons, Inc. All rights reserved.

5-‹#›

DNS Response

DN S R

eq ue

st

DN S R

es po

ns e

DNS Response

DNS Request St

ep

3

Step 6

Step 7 Step 4

Step 5

St ep

2

DNS Request

Step 1

Step 8

DNS Response

DNS Request

Client computer Resolving

name server

Root server

Top Level Domain (TLD) server

Authoritative name server