Chapter 3 a

36
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 3: Networking and Internetworking

Transcript of Chapter 3 a

Page 1: Chapter 3 a

From Coulouris, Dollimore, Kindberg and Blair

Distributed Systems: Concepts and Design

Edition 5, © Addison-Wesley 2012

Slides for Chapter 3: Networking and Internetworking

Page 2: Chapter 3 a

Network Performance

The main network performance parameters are those affecting the speed with which individual messages can be transferred between two interconnected computers.

Latency is the delay that occurs after a send operation is executed and before data starts to arrive at the destination computer. It can be measured as the time required to transfer an empty message.

Data transfer rate is the speed at which data can be transferred between two computers in the network once transmission has begun, usually quoted in bits per second.

Message transmission time = latency + length ⁄ data transfer rate

The total system bandwidth of a network is a measure of throughput – the total volume of traffic that can be transferred across the network in a given time.

2

Page 3: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.1Network performance

km

Page 4: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.2Conceptual layering of protocol software

Layer n

Layer 2

Layer 1

Message sent Message received

Communication

medium

Sender Recipient

Page 5: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.3Encapsulation as it is applied in layered protocols

Presentation header

Application-layer message

Session header

Transport header

Network header

Page 6: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.4Protocol layers in the ISO Open Systems Interconnection (OSI) model

Application

Presentation

Session

Transport

Network

Data link

Physical

Message sent Message received

Sender Recipient

Layers

Communicationmedium

Page 7: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.5OSI protocol summary

Layer Description Examples

Application Protocols that are designed to meet the communication requirements ofspecific applications, often defining the interface to a service.

HTTP, FTP , SMTP,CORBA IIOP

Presentation Protocols at this level transmit data in a network representation that isindependent of the representations used in individual computers, which maydiffer. Encryption is also performed in this layer, if required.

Secure Sockets(SSL),CORBA DataRep.

Session At this level reliability and adaptation are performed, such as detection offailures and automatic recovery.

Transport This is the lowest level at which messages (rather than packets) are handled.Messages are addressed to communication ports attached to processes,Protocols in this layer may be connection-oriented or connectionless.

TCP, UDP

Network Transfers data packets between computers in a specific network. In a WANor an internetwork this involves the generation of a route passing throughrouters. In a single LAN no routing is required.

IP, ATM virtualcircuits

Data link Responsible for transmission of packets between nodes that are directlyconnected by a physical link. In a WAN transmission is between pairs ofrouters or between routers and hosts. In a LAN it is between any pair of hosts.

Ethernet MAC,ATM cell transfer,PPP

Physical The circuits and hardware that drive the network. It transmits sequences ofbinary data by analogue signalling, using amplitude or frequency modulationof electrical signals (on cable circuits), light signals (on fibre optic circuits)or other electromagnetic signals (on radio and microwave circuits).

Ethernet base- bandsignalling, ISDN

Page 8: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.6Internetwork layers

Underlying network

Application

Network interface

Transport

Internetwork

Internetwork packets

Network-specific packets

MessageLayers

Internetworkprotocols

Underlyingnetworkprotocols

Page 9: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.7Routing in a wide area network

HostsLinks

or local

networks

A

D E

B

C

1

2

5

43

6

Routers

Page 10: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.8Routing tables for the network in Figure 3.7

Routings from D Routings from E

To Link Cost To Link Cost

A

B

C

D

E

3

3

6

local

6

1

2

2

0

1

A

B

C

D

E

4

4

5

6

local

2

1

1

1

0

Routings from A Routings from B Routings from C

To Link Cost To Link Cost To Link Cost

A

B

C

D

E

local

1

1

3

1

0

1

2

1

2

A

B

C

D

E

1

local

2

1

4

1

0

1

2

1

A

B

C

D

E

2

2

local

5

5

2

1

0

2

1

Page 11: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.9Pseudo-code for RIP routing algorithm

Send: Each t seconds or when Tl changes, send Tl on each non-faulty outgoing link.Receive: Whenever a routing table Tr is received on link n:for all rows Rr in Tr {if (Rr.link | n) {Rr.cost = Rr.cost + 1;Rr.link = n;if (Rr.destination is not in Tl) add Rr to Tl; // add new destination to Tlelse for all rows Rl in Tl {if (Rr.destination = Rl.destination and

(Rr.cost < Rl.cost or Rl.link = n)) Rl = Rr;// Rr.cost < Rl.cost : remote node has better route// Rl.link = n : remote node is more authoritative}}}

Page 12: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Internetworking

To build an integrated network (an internetwork) we must integrate many subnets. To make this possible, the following are needed:

a unified internetwork addressing scheme that enables packets to be addressed to any host connected to any subnet;

a protocol defining the format of internetwork packets and giving rules according to which they are handled;

interconnecting components that route packets to their destinations in terms of internetwork addresses, transmitting the packets using subnets with a variety of network technologies.

Page 13: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.10Simplified view of part of a university campus network

file

compute

dialup

hammer

henry

hotpoint

138.37.88.230

138.37.88.162

bruno138.37.88.249

router/sickle

138.37.95.241138.37.95.240/29

138.37.95.249

copper138.37.88.248

firewall

web

138.37.95.248/29

server

desktop computers 138.37.88.xx

subnet

subnet

Eswitch

138.37.88

server

server

server

138.37.88.251

custard138.37.94.246

desktop computers

Eswitch

138.37.94

hubhub

Student subnetStaff subnet

otherservers

router/firewall

138.37.94.251

1000 Mbps EthernetEswitch: Ethernet switch

100 Mbps Ethernet

file server/gateway

printers

Campusrouter

Campusrouter

138.37.94.xx

Page 14: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.11Tunnelling for IPv6 migration

A BIPv6 IPv6

IPv6 encapsulated in IPv4 packets

Encapsulators

IPv4 network

Page 15: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.12TCP/IP layers

Messages (UDP) or Streams (TCP)

Application

Transport

Internet

UDP or TCP packets

IP datagrams

Network-specific frames

MessageLayers

Underlying network

Network interface

TCP/IP, including the Web (HTTP), email (SMTP, POP), file transfer (FTP) and Telnet (telnet)

Page 16: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.13Encapsulation in a message transmitted via TCP over an Ethernet

Application message

TCP header

IP header

Ethernet header

Ethernet frame

port

TCP

IP

Page 17: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.14The programmer's conceptual view of a TCP/IP Internet

IP

Application Application

TCP UDP

Page 18: Chapter 3 a

IP Addressing

Assigning host addresses to networks and the computers connected to them had to satisfy the following requirements:

• It must be universal – any host must be able to send packets to any other host in the Internet.

• It must be efficient in its use of the address space – it is impossible to predict the ultimate size of the Internet and the number of network and host addresses likely to be required.

TCP/IP provision for 232 or approximately 4 billion addressable hosts.

Short-sighted, for two reasons:– The rate of growth of the Internet has far outstripped all predictions.

– The address space has been allocated and used much less efficiently than expected.

18

Page 19: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.15Internet address structure, showing field sizes in bits

7 24

Class A: 0 Network ID Host ID

14 16

Class B: 1 0 Network ID Host ID

21 8

Class C: 1 1 0 Network ID Host ID

28

Class D (multicast): 1 1 1 0 Multicast address

27

Class E (reserved): 1 1 1 1 unused0

28

Page 20: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.16Decimal representation of Internet addresses

octet 1 octet 2 octet 3

Class A: 1 to 127

0 to 255 0 to 255 1 to 254

Class B: 128 to 191

Class C: 192 to 223

224 to 239 Class D (multicast):

Network ID

Network ID

Network ID

Host ID

Host ID

Host ID

Multicast address

0 to 255 0 to 255 1 to 254

0 to 255 0 to 255 0 to 255

0 to 255 0 to 255 0 to 255

0 to 255 0 to 255 1 to 254240 to 255 Class E (reserved):

1.0.0.0 to 127.255.255.255

128.0.0.0 to 191.255.255.255

192.0.0.0 to 223.255.255.255

224.0.0.0 to 239.255.255.255

240.0.0.0 to 255.255.255.255

Range of addresses

Page 21: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.17IP packet layout

dataIP address of destinationIP address of source

header

up to 64 kilobytes

Page 22: Chapter 3 a

Unregistered addresses and Network Address Translation (NAT)

Not all of the computers and devices that access the Internet need to be assigned globally unique IP addresses.

Computers that are attached to a local network and access to the Internet through a NAT-enabled router can rely upon the router to redirect incoming UDP and TCP packets for them.

The network includes Internet-enabled computers that are connected to the router by a wired Ethernet connection as well as others that are connected through a WiFi access point.

22

Page 23: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.18 A typical NAT-based home network

Page 24: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.19IPv6 header layout

Source address(128 bits)

Destination address(128 bits)

Version (4bits)

Traffic class (8bits)

Flow label (20bits)

Payload length (16 bits) Hop limit (8 bits)

Next header (8bits)

Page 25: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.20The MobileIP routing mechanism

Sender

Home

Mobile host MH

Foreign agent FAInternet

agent

First IP packet addressed to MH

Address of FAreturned to sender

First IP packettunnelled to FA

Subsequent IP packetstunnelled to FA

Page 26: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.21Firewall configurations

Internet

Router/Protected intraneta) Filtering router

Internet

b) Filtering router and bastion

filter

Internet

R/filterc) Screened subnet for bastion R/filter Bastion

R/filter Bastion

web/ftpserver

web/ftpserver

web/ftpserver

Page 27: Chapter 3 a

Firewall

IP packet filtering: This is a filter process examining individual IP packets. It may make decisions based on the destination and source addresses.

It may also examine the service type field of IP packets and interpret the contents of the packets based on the type.

For example, it may filter TCP packets based on the port number to which they are addressed, and since services are generally located at well-known ports, this enables packets to be filtered based on the service requested. For example, many sites prohibit the use of NFS servers by external clients.

27

Page 28: Chapter 3 a

Firewall

TCP gateway: A TCP gateway process checks all TCP connection requests and segment transmissions.

When a TCP gateway process is installed, the setting up of TCP connections can be controlled and TCP segments can be checked for correctness (some denial of service attacks use malformed TCP segments to disrupt client operating systems).

When desired, they can be routed through an application-level gateway for content checking.

28

Page 29: Chapter 3 a

Application-level gateway: An application-level gateway process acts as a proxy for an application process.

For example, a policy may be desired that allows certain internal users to make Telnet connections to certain external hosts.

When a user runs a Telnet program on their local computer, it attempts to establish a TCP connection with a remote host.

The request is intercepted by the TCP gateway. The TCP gateway starts a Telnet proxy process and the original TCP connection is routed to it. If the proxy approves the Telnet operation (i.e., if the user is authorized to use the requested host) it establishes another connection to the requested host and relays all of the TCP packets in both directions.

A similar proxy process would run on behalf of each Telnet client, and similar proxies might be employed for FTP and other services.

29

Firewall

Page 30: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.22IEEE 802 network standards

IEEE No. Name Title Reference

802.3 Ethernet CSMA/CD Networks (Ethernet) [IEEE 1985a]

802.4 Token Bus Networks [IEEE 1985b]

802.5 Token Ring Networks [IEEE 1985c]

802.6 Metropolitan Area Networks [IEEE 1994]

802.11 WiFi Wireless Local Area Networks [IEEE 1999]

802.15.1 Bluetooth Wireless Personal Area Networks [IEEE 2002]

802.15.4 ZigBee Wireless Sensor Networks [IEEE 2003]

802.16 WiMAX Wireless Metropolitan Area Networks [IEEE 2004a]

Page 31: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.23Ethernet ranges and speeds

10Base5 10BaseT 100BaseT 1000BaseT

Data rate 10 Mbps 10 Mbps 100 Mbps 1000 Mbps

Max. segment lengths:

Twisted wire (UTP) 100 m 100 m 100 m 25 m

Coaxial cable (STP) 500 m 500 m 500 m 25 m

Multi-mode fibre 2000 m 2000 m 500 m 500 m

Mono-mode fibre 25000 m 25000 m 20000 m 2000 m

Page 32: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.24Wireless LAN configuration

LAN

Server

WirelessLAN

Laptops

Base station/access point

Palmtop

radio obstruction

A B C

DE

Page 33: Chapter 3 a

Issues

Hidden stations: Carrier sensing may fail to detect that another station on the network is transmitting.

If tablet D is transmitting to the base station E, laptop A may not be able to sense D’s signal because of the radio obstruction shown. A might then start transmitting, causing a collision at E unless steps are taken to prevent this.

Fading: Due to the inverse square law of electromagnetic wave propagation, the strength of radio signals diminishes rapidly with the distance from the transmitter. Stations within a wireless LAN may be out of range of other stations in the same LAN.

Thus laptop A may not be able to detect a transmission by C, although each of them can transmit successfully to B or E. Fading defeats both carrier sensing and collision detection.

33

Page 34: Chapter 3 a

Issues

Collision masking: The ‘listening’ technique used in the Ethernet to detect collisions is not very effective in radio networks.

Because of the inverse square law the locally generated signal will always be much stronger than any signal originating elsewhere, effectively drowning out the remote transmission.

So, laptops A and C might both transmit simultaneously to E and neither would detect that collision, but E would receive only a garbled transmission.

34

Page 35: Chapter 3 a

Carrier Sensing, Multiple Access with Collision Avoidance (CSMA/CA).

When a station is ready to transmit, it senses the medium. If it detects no carrier signal it may assume that one of the following conditions is true:

1. The medium is available.

2. An out-of-range station is in the process of requesting a slot.

3. An out-of-range station is using a slot that it had previously reserved.

35

Page 36: Chapter 3 a

Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 3.25Bluetooth frame structure

SCO packets (e.g. for voice data) have a 240-bit payload containing 80 bits of data triplicated, filling exactly one timeslot.

bits: 72 18 18 18 0 - 2744

Access code Headercopy 1

Headercopy 2

Headercopy 3

Data for transmission

bits: 3 1 1 1 4 8

Destination Flow Ack Seq Type Header checksum

Address withinPiconet

= ACL, SCO,poll, null

Header