© Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant...

34
© Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information

Transcript of © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant...

Page 1: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

© Original by Donald Acton; Changes by George Tsiknis

Computer Networks

Text has no relevant information

Page 2: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 2

Learning Outcomes

Be able to explain the differences between different types of computer networks

Be able to identify differences in connection based and connectionless communication protocols

Be able to explain the way data are exchanged between two machines in term of the standard protocols and their data headers

Page 3: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 3

What do we know about Networking?

So far we have looked at the socket APIdiscussed the basic actions that applications have to

perform to communicate been aware of threads and how to use themseen how to use semaphores to deal with problems

that require the application to process more than one thing at a time

Page 4: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 4

Is this enough?

What happens when we send our data from one machine to another?

With respect to network programming: Is it certain that the data will always arrive?Should we care how long it might take for data to

arrive?Should we care about the data arrival rate?etc.

Would knowledge about any of these things change the way we design a program?

Page 5: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 5

How can computers be connected?

Page 6: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 6

Communication paths

When data is exchanged between computers it may traverse many different network types and travel at different speeds

– 100 Mb/s - local Ethernet (copper wire)– 1 Gb/s - local backbone (fiber)– 155 Mbs/s - OC3 leased line– 10 Gb/s – OC192 backbone– 11 Mb/s - 802.11g to the laptop

Page 7: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 7

What’s a Network? A network is a Collection of interconnected computers. Depending on the number of computers and the distance

between them we can form: Local Area Networks (LAN)

cover small local area, like a home, office, or campus are fast can be wireless

Metropolitan Area Networks (MAN) usually spanning a campus or a city typically use wireless structure or optical fiber connections to

link their sites. Wide Area Networks (WAN)

cover a wide area, involve a large number of computers usually connect LAN’s and MAN’s Internet is a WAN

Page 8: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 8

Local Area Networks

Bus: Computers are connected to a central cable (bus). Also called Ethernet.

Ring: Computers are connected into a loop.

Star: Computers are connected to a hub or a switch

most popular nowadays Network Hub:

has ports where computers are attached

repeats the signal received at one port out each of the other ports

Network Switch: Like a hub, but it only sends the

signal to one other port

or

Page 9: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 9

Metropolitan Area Networks[Tan02]

Page 10: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 10

Wide Area Networks [Tan02]

Notes in the subnet are usually routers. A router acts as a junction between two or more

networks to transfer data among them.

Backbone

Page 11: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 11

Satellite Links

Page 12: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 12

Architecture of the Internet [Tan02]

Network Access Point: huge interconnection points Points Of Presence: connects clients to an ISP To connect a computer to Internet, we connect it to an

ISP computer via a modem.

Page 13: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 13

Distinguishing Network Characteristics

Latency - how long it takes data to get from one location to the next

Bandwidth – the amount of data that can be moved in a given unit of time

Jitter – the variability in latency Error rate – how frequently data becomes

corrupted during transmission

Page 14: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 14

Data transmission

Signal transmission over cables, fiber optics, or other media generates errors; Sender may have to re-send a message many times

For efficiency, messages are divided into fix-size packets before they sent

Two ways to send the packets:Using Connectionless Service (or Datagram)Using Connection-Oriented Service (or virtual circuit )

Page 15: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 15

Connection Based Service(TCP/IP)

Sending and receiving hosts establish a connection Sender

Splits sequence of outgoing bytes into packets Remembers sent packets in case they are lost and need to be

resent Receiver

Receives packets Reassembles packets into a sequence of bytes If packets don’t arrive in a given time requests the sender to

retransmit them Produces a reliable streamed delivery of data The most common protocol supported by most OS’s is

TCP/IP TCP – Transmission Control Protocol IP – Internet Protocol

Page 16: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 16

Datagram (UDP)

Not streamed – data arrives in the “chunks” that the sender sent, called datagrams

Datagrams have a maximum size Datagrams are individually addressed Datagrams may be lost Datagrams may arrive out of order

No connection setup No connection state

The most common protocol supported by most OS’s is UDP – User Datagram Protocol

Page 17: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 17

Protocol

A formally agreed upon convention for performing or engaging in some sort of activity

A data communication protocol is an example of a protocol to exchange data between machinesA connection protocol describes how two machines

establish a connection. (Usually a subset of a data communication protocol)

Page 18: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 18

Introducing Protocol Layers

Communication protocols are usually designed as a stack of layers

Similar idea to virtual machine Add layers to perform various functions

Lowest layer deals with hardwareNext layer deals with moving data to the destination

machineNext layer handles correcting errors and lost data (if

appropriate) and getting data to applicationLast layer is the application

Page 19: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 19

Layering Yet Again!

Application programs

Operating system

Hardware

General Layering

Structure

Application

Transport

Network

Link

Network

Layering

Application

Unix I/O

File System

Disk Drive

File System

Layering

Page 20: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 20

Protocol Layers

Application

Transport

Network

Link

Application

Transport

Network

Link

telnet, FTP, SMTP, HTTP

TCP, UDP

IP

Ethernet, token ring, wireless

Page 21: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 21

Layers of Functionality

Each layer hides the details from the layer above and uses the services of the layer below

A layer in a node A interacts with the same layer in another node B (using the layers below it )

Specifically: Link – moves the data between directly connected

nodes on the path to the destination Network – used to route the data between the

source/destination end points Transport – application to application delivery Application – application level interchanges

Page 22: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 22

Encapsulation

To achieve the desired functionality each layer adds “headers” to the data it receives

Headers are meant for the corresponding layer at the destination

Headers are removed at the destination layer

Page 23: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 23

Protocol headers

Application

Transport

Network

Link

Application data

TCP Header

A. Data TCP HeaderIP Header

A. DataTCP HeaderIP HeaderEthernet Header

A. Data A. Data

TCP Header A. DataA. Data

Page 24: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 24

Protocol headers: Going Down

Application

Transport

Network

Link

A. Data

A. DataTCP Header

A. DataTCP HeaderIP Header

A. DataTCP HeaderIP HeaderEthernet Header

Page 25: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 25

Protocol headers: Coming up

Application

Transport

Network

Link A. DataTCP HeaderIP HeaderEthernet Header

Page 26: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 26

Header Contents

Source Port

Destination Port

Sequence Number

ACK Number

Additional Fields

Control Fields

(Includes transport protocol type)

Source IP Address

Destination IP Address

Options

Dest Ethernet Addr

Source. Ethernet Addr

Type/Size

TCP IP Ethernet

Page 27: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 27

Routing example

Application

Transport

Network

Link

Network

Link Link

Application

Transport

Network

Link

Source Destination

Application data TCP Header IP Header Ethernet Header802.11G Header

Page 28: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 28

Routing

Page 29: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 29

Protocol Processing

TCP UDP

IP

Ethernet Wireless

AP1

Application

Protocol 1

AP2

Application

Protocol 2

AP3

Application

Protocol 3

Page 30: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 30

TCP Acknowledgement Normal Operation, no loss

Send pkt0 pkt0

recv ACK0Send pkt1 pkt1

recv ACK1Send pkt2

pkt2

recv pkt0Send ACK0

ACK0

recv pkt1Send ACK1ACK1

recv pkt2Send ACK2

recv ACK2

ACK2

Page 31: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 31

TCP Acknowledgement Lost Packet

Send pkt0 pkt0

Send pkt1pkt1

recv pkt0Send ACK0

ACK0

recv pkt1Send ACK1

ACK1

recv ACK0

pkt2

Timeout

recv ACK0Send pkt1 pkt1

Xloss

Page 32: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 32

Extending Device I/O

Layering makes it “easy” to incorporate networking in the OSextend I/O to devices that are connected to computer

through a network Example:

Network File Systems (NFS) Just insert the new service at the appropriate

layer

Page 33: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 33

File System

Inserting New Functionality

SCSI IDE

Virtual Disk Interface

UNIX FFS Logging FS NFS Client

Network Protocol Stack

UNIX I/O

Application

Virtual Disk Interface

Other Devices

Page 34: © Original by Donald Acton; Changes by George Tsiknis Computer Networks Text has no relevant information.

Unit 19 34

From the beginning to the end

Application programs

Hardware

Operating system

STDIO

GCC Mozilla emacs

STDIO

GCC Firefox emacs

UNIX I/O

FFS LFS

Virtual Disk interface

IDE SCSI Other devices

Protocol

Stack UNIX I/O

FFS LFS

Virtual Disk interface

IDE SCSI Other devices

Protocol

Stack

Link

IP

Transport

Virtual Machine Monitor

CPU Motherboard

DisksDisplay Network card

etc

Virtual Machine Monitor

CPU Motherboard

DisksDisplay Network card

etc