1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

30
1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks

Transcript of 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

Page 1: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

1

MCT620 – Distributed Systems

Workshop 1 – Lecture 3Introduction to Networks

Page 2: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

2

Introduction to Distributed Systems

Lecture 1 – Introduction to Distributed Systems

Lecture 2 – History of Distributed Systems

Lecture 3 – Introduction to Networks

Page 3: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

3

In this Lecture ….

Protocol HierarchiesArchitecture of the InternetIP Addressing & ClassesSubnettingTransmission Control Protocol -

TCPUser Datagram Protocol - UDP

Page 4: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

4

Protocol Hierarchies

Page 5: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

5

Protocol Hierarchies (2)

The philosopher-translator-secretary architecture

Page 6: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

6

Protocol Hierarchies (3)

Page 7: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

7

Architecture of the Internet

Page 8: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

8

TCP/IP Reference Model (1)

Page 9: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

9

Format of the IP datagram

Page 10: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

10

The big picture

m-routed ping traceroute app app app app traceroute ping

IPv4 ApplicationsAF_INET

sockaddr_in{}

IPv6 ApplicationsAF_INET6

sockaddr_in6{}

TCP UDP

IPv4 IPv632 bit

address128 bit

addressICMP

v6

ICMP

ARP/RARP

data-link

IGMP

API

transport

network

Page 11: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

11

User Datagram Protocol (1)

Simple transport layer protocol described in RFC 768, in essence just a IP datagram with a short header

Provides a way to send encapsulated raw IP datagrams without having to establish a connection

Page 12: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

12

User Datagram Protocol (2)The application writes a datagram to a UDP

socket, which is encapsulated as either IPv4 or IPv6 datagram that is sent to the destination; there is no guarantee that UDP datagram ever reaches its final destination

Many client-server application that have one request – one response use UDP

Each UDP datagram has a length; if a UDP datagram reaches its final destination correctly, then the length of the datagram is passed onto the receiving application

UDP provides a connectionless service as there is no need for a long term relation-ship between a client and the server

Page 13: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

13

UDP header

Page 14: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

14

Transmission Control Protocol (1)Provides a reliable end to end byte stream over

unreliable internetwork (different parts may have different topologies, bandwidths, delays, packet sizes, etc…)

Accepts user data streams from local processes, breaks them into pieces (not larger than 64KB) and sends each piece as a separate IP datagram- tt the receiving end, the IP datagrams that contains TCP packets, are delivered to the TCP transport entity, which reconstructs the original byte stream

The IP layer gives no guarantee that the datagrams will be delivered properly, so it is up to TCP to time out and retransmit them as the need arises

Datagrams that arrive, may be in the wrong order; it is up to TCP to reassemble them into messages in the proper sequence

Page 15: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

15

Transmission Control Protocol (2)Each byte on a TCP connection has its

own 32 bit sequence number, used for various purposes (re-arrangement of out of sequence segments; identification of duplicate segments, etc…)

Sending and receiving TCP entities exchange data in the form of segments. A segment consists of a fixed 20 byte fixed header (plus an optional part) followed by zero or more data bytes

Page 16: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

16

TCP Service Model (1)Provides connections between clients and

servers, both the client and the server create end points, called sockets◦ Each socket has a number (address) consisting of the

IP address of the host and a 16 bits number, local to that host, called port (TCP name for TSAP)

◦ To obtain a TCP service, a connection has to be explicitly established between the two end points

◦ A socket may be used for multiple connections at the same time

◦ Two or more connections can terminate in the same socket; connections are identified by socket identifiers at both ends (socket1, socket2)

Provides reliability◦ When TCP sends data to the other end it requires

acknowledgement in return; if ACK is not received, the TCP entity retransmits automatically the data and waits a longer amount of time

Page 17: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

17

TCP Service Model (2)

All TCP connections are full duplex and point to point (it doesn’t support multicasting or broadcasting)

A TCP connection is a byte stream not a message stream (message boundaries are not preserved)◦ i.e. if a process is doing four writes of 512

bytes to a TCP stream, data may be delivered at the other end as four 512 bytes reads, two 1024 bytes reads or one 2048 read

Page 18: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

18

TCP IP Client Server Interaction

Page 19: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

19

IP Addressing

Page 20: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

20

Internet Classes

Page 21: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

21

Dotted decimal notation

Page 22: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

22

Class ranges for Internet addresses

Page 23: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

23

Campus network example

Consider a large organization with class B addresses (140.203.0.0)

Page 24: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

24

Subnets (1)

Page 25: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

25

Subnets (2)In our example, the subnets are as follows:

◦ Subnet 1: 10001100 11001011 000001|00 00000000 Subnet: 140.203.4.0 Subnet mask: 255.255.252.0 First host in the subnet 1: 140.203.4.1

◦ Subnet 2: 10001100 11001011 000010|00 00000000 Subnet: 140.203.8.0 Subnet mask: 255.255.252.0 First host in the subnet 2: 140.203.8.1

◦ Subnet 3: 10001100 11001011 000011|00 00000000 Subnet: 140.203.12.0 Subnet mask: 255.255.252.0 First host in the subnet 3: 140.203.12.1

Page 26: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

26

CIDR

Basic idea is to allocate the remaining IP addresses in variable-sized blocks, without regard to the classes.

If a site needs, say 2000 addresses, it is given a block of 2048 addresses on a 2048 byte boundary

Dropping classes makes the routing more complicated, the old routing algorithm is not working anymore

Page 27: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

27

CIDR practical example (1)

Addresses are available at 194.24.0.0

Page 28: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

28

NAT

Page 29: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

29

IPv6

CIDR and NAT may “buy” a few more years, but the days of IPv4 are numbered (address shortage problem)

1990, IETF started to work on IPv6, with a number of ambitious goals

However, it’s still not widely deployed

Page 30: 1 MCT620 – Distributed Systems Workshop 1 – Lecture 3 Introduction to Networks.

30

Summary

In this lecture we have looked at some of the aspects of networking that impact on the way that Distributed Systems are designed.

We have seen how Protocol Hierarchies allow us to reduce complexity by abstracting detail into different layers.

The Architecture of the Internet has an ever growing influence on Distributed System design and we have seen how it is organised.

TCP & UDP are important protocols for internet based systems – we meet them again next week in the context of socket programming.