jozef goetz, 2008 1 copyright © the mcgraw-hill companies, inc. permission required for...

90
zef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Upload: delilah-moody

Post on 31-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

1

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

expanded by Jozef Goetz, 2008

Page 2: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

2

2-1 LAYERED TASKS2-1 LAYERED TASKS

•We use the concept of We use the concept of layerslayers in our daily life. in our daily life. •As an example, let us consider As an example, let us consider two friends who two friends who communicate through postal mail. communicate through postal mail.

•The process of The process of sending a lettersending a letter to a to a friendfriend would be would be complexcomplex if if there were no servicesthere were no services available from the available from the post office. post office.

Sender, Receiver, and CarrierHierarchy

Topics discussed in this section:Topics discussed in this section:

Page 3: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

3Figure 2.1 Sending a letter The concept of layers

There is a hierarchy (order) of different asks: •e.g. at the sender site.

•The letter must be written and dropped in the mailbox before being picked up by the letter carrier and delivered to PO

with the sender and receiver address

sorted and

and sorted

Note: each layer at the sending site uses the services of the layer immediately below it.

Home layer

PO layer

Mailbox layer

Page 4: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

4

Page 5: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

5

Page 6: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

6

Page 7: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

7

Page 8: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

8

2-2 THE OSI MODEL2-2 THE OSI MODEL

•Established in 1947, the Established in 1947, the International Standards International Standards OrganizationOrganization ( (ISOISO) is a multin) is a multinaational body dedicated to tional body dedicated to worldwide agreement on international standards. worldwide agreement on international standards. •An ISO standard that covers all aspects of network An ISO standard that covers all aspects of network communications is the communications is the Open Systems InterconnectionOpen Systems Interconnection ((OSIOSI) model. ) model.

•It was first introduced in the late 1970s.It was first introduced in the late 1970s.

Layered ArchitecturePeer-to-Peer ProcessesEncapsulation

Topics discussed in this section:Topics discussed in this section:

Page 9: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

9

ISO is the organization.OSI is the model.

Note

Page 10: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

10

Figure 2.2 Seven layers of the OSI model

Page 11: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

11Figure 2.2 Internet layers

Page 12: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

12Figure 2.3 Peer-to-peer processes

Page 13: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

13Protocol Hierarchies

Layers: Networks are organized as a stack of levels or layers to reduce their design

complexity. Each layer perform a specific collection of well–understood

related functions We build each layer on the one below it. Each layer talks to the ones above & below it Each layer hides underlying details from the one above it – sort of a

virtual machine, offering certain services (operations) to the layer above it Layers differ in number and function from one network to another.

Page 14: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

14 interfaces and protocols Between each pair of

adjacent layers is an interface.

defines what information and services the lower layers makes available to the upper one.

Well defined interfaces and layers provide modularity to a network

Layers or their services (functions) are replaceable

The corresponding layers on different machines are called peers

The peers communicate by using protocols

Page 15: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

15Services to Protocols Relationship

Services is a set primitives (operations) that the layer provides to the layer above it

What functions does this layer provide? Services like an abstract data type in OOD

Protocols is a set of rules governing the format and meaning of the packets and/or msgs that are exchange by the peers entities within a layer.

A protocol relates to the implementation of the service and as such is not visible to the user of the service

Entities use protocols to implement their service definition

The services and the protocols are completely decoupled Protocols can be changed but the service can remain the same

Page 16: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

16

Figure 2.3 The interaction between layers in the OSI model

Page 17: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

17Protocols

Protocols:1. Define data types for transmission2. Provide different services (a set of

operations) Initiate a connection Transmit data Terminate a connection

Are layered to form architectures

Page 18: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

18

Page 19: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

19Figure 2.4 An exchange using the OSI model

Each layer in the sending device •adds its own info (header) to the msg it receives from the layer just above it and •passes the whole package to the layer below

At the receiving device, the msg is unwrapped layer by layer:•i.e. the headers and trailers (T2) attached to it at the corresponding sending layer are removed, and actions appropriate to that layer are taken

Page 20: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

20

Figure 2.4 An exchange using the Internet model

Encapsulation concept: a packet at level 5 is encapsulated in packet at level 4. Level 4 is not aware which part of the encapsulated packet is data and which part is the header. The packet in level 4 is encapsulated in packet at level 3, and so on.

Page 21: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

21Protocol encapsulation

e-mail client

TCP server

IP server

ethernetdriver/card

user X

e-mail server

TCP server

IP server

ethernetdriver/card

user Y“Hello”

“Hello”

“Hello”

“Hello”

“Hello”

Page 22: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

22

1. The physical layer is responsible for transmitting individual bits from one

node to the next.

Note:Note:

Physical Layer PL 1

Page 23: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

23 Physical layer

•Concerned with the characteristics of the physical medium to transfer row bits over a communication channel.

•Deals with •mechanical, •electrical, •functional, •procedural and •timing interfaces, and •the physical medium itself.

Page 24: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

24Physical layer duties

1. Physical characteristics of interfaces and media• Plug types, materials etc.

2. Representation of bits• E.g. TTL 5v = 1, 0 = 0v, RS232C 1 = -12v, 0 = +12v• Sensitivity of receivers, e.g. minimum voltage for 1 in RS232C is -3v

3. Data Rate/Transmission Rate• How many bits per second

4. Synchronization of bits• Not only the bit rate but when does a char or frame/packet start and

end5. Transmission mode: simplex, half-duplex, or full-duplex6. Physical topology: mesh, star, bus, ring, or hybrid

Page 25: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

25

Shows relationship of it to other layers

Data Link Layer 2

Page 26: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

26Figure 2.7 Node-to-node delivery by the DLL

The data link layer is responsible for transmitting frames from one node to the next (of the same network).

Page 27: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

27

Data Link Layer 2 - point-to-point connection Deals with transforming a raw line into a

line that appears free of errors to the network layer.

It accomplishes with breaking up the data into data frames, transmit the frames sequentially, and then receiving acknowledgements back.

This layer also deals with different hardware speeds by slowing some transmissions if the other end can’t keep up.

How much buffer space the receiver has? How the error is handled?

Page 28: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

28Data link layer duties:

•Framing• the data link layer DLL divides the stream of bits into manageable data units called frames

• Physical Addressing• adds a header to the frame containing sender and/or receiver address

• Flow Control• Controls how fast a transmitter can send to a receiver

• Error Control• Detection and recovery from error conditions or lost frames

•Achieved through a trailer added to the end of the frame

• (Medium) Access Control• who has control over the link at any given time

•Fair access to shared data link networks e.g. Ethernet

Page 29: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

29Figure 2.19 Example 1

•In Figure below a node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link. At the data link level this frame contains physical addresses in the header.

•These are the only addresses needed. The rest of the header contains other information needed at this level. •The trailer usually contains extra bits needed for error detection

Page 30: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

30

Network Layer NL 3

Shows relationship of it to other layers

Page 31: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

31Figure 2.9 Source-to-destination delivery across different networks

The network layer is responsible for the delivery of packets from the original source to the final destination (across different network).

Page 32: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

32

Network Layer 3 Controls the operation of the subnet.

A key design issue is - determining how packets are routed.

Packet routing may be static (based on static tables ex. determined from a

terminal session) or dynamic (determined for each packet), depending

on the type of network.

Other issues: congestion control, quality of service: (delay, transit time etc.), overcome protocol differences

Page 33: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

33Network layer duties

1. Source to Destination Delivery• Beyond the same link• Interconnected basic different networks

2. Logical Addressing• if packet passes the network boundary we need to distinguish

the source and destination network by adding header with the logical sender and receiver addresses

• so we separate from physical addressing at data link

3. Routing/Internetworking• determine how to get from the source to the destination• connecting devices (routers or switches ) are used to route to

the proper destination

Page 34: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

34Figure 2.20 Example 3

•In Figure we want to send data from a node with network address A and physical address 10, located on one LAN, to a node with a network address P and physical address 95, located on another LAN.

•Because the two devices are located on different networks, we cannot use physical addresses only;

•the physical addresses only have local jurisdiction.

•What we need here are universal addresses that can pass through the LAN boundaries?

•The network (logical) addresses have this characteristic.

Page 35: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

35

Transport layer TL 4

The transport layer is responsible for delivery of a message from one process

to another.

Note: Note: NetworkNetwork L.L. deliver deliver individualindividual packets packets, it , it doesn't recognize any relationship doesn't recognize any relationship between packetsbetween packets which belonged to some msgs. which belonged to some msgs.

Page 36: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

36Figure 2.11 Reliable process-to-process delivery of a message

Page 37: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

37

Transport Layer 4 Serves as the interface between the Session

and Network layers.

• The Transport Layer is responsible for breaking up larger messages from the session layer

into smaller messages (segments) and then sending them across the network layer making sure the all pieces arrive correctly to the

destination

The transport layer is a true end-to-end layer, all the way from the source to the destination

A program on the source machine carries on a conversation with the similar program on the destination machine

In the lower layers, the protocols are between each machine and its immediate neighbors, not between the ultimate source and destination.

Page 38: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

38Transport layer duties

1. Port addressing• Process (running program) on one computer

delivers a message (msg) to a specific process on the other.• To identify the process the port address is

provided to the TL

2. Segmentation and reassembly control• Sending large amounts of data needs to be

managed by breaking down into transmissible segments • Each segment contains a sequence # in order to

reassemble msg at the destination

Page 39: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

39Transport layer duties

3. Connection control• Do you want a phone call like service

(connection oriented service) or a postcard like service (connectionless service)

4. Flow control• End to End control at a process level

5. Error control• End to End error control rather than a single

link• Make sure no error (damage, loss, or duplicates)

at the receiving TL

Page 40: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

40Figure. Example 3. Internet Model

Figure shows an example of transport layer communication. Data coming from the upper layers have port addresses j and k (j is the address of the sending process, and k is the address of the receiving process).

•Since the data size is larger than the network layer can handle, the data (message) are split into two packets, each packet retaining the port addresses (j and k).

Then in the network layer, network addresses (A and P) are added to each packet.

Page 41: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

41

Session layer 5

The session layer is responsible for dialog control and synchronization.

Page 42: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

42

Session Layer 5

Allows users on different machines to establish a session between them.

Session services include: dialog control (who transmits next)

• communications between 2 Ps in half-duplex, or full-duplex synchronization (checkpointing long transactions

so they can continue after a crash)• SL allows to add checkpoints, or synchronization points,

to a stream data in order if a crash happens during the retransmission send one from the last checkpoint

token management (preventing the same critical operation at the same time).

Page 43: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

43

Handles the syntax and semantics of the info exchanged between systems.

Presentation Layer 6

The presentation layer is responsible for translation, compression, and encryption.

Page 44: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

44

Presentation Layer 6

1. Manages translation Allows data to move from one machine

to another while retaining the appropriate format.

allows higher-level data structure (e.g., banking records), to be defined into a

common format at the sender and send it to the receiver which converts into its receiver-dependent format.

Page 45: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

45

Presentation Layer 6

2. Encryption The sender transforms the orginal info

to another form and sends msg out over the network

Decryption reverses to its orginal form at the receiver

3. Compression Reduces the # of bits

Important for sending text, audio, and video

Page 46: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

46

The application layer is responsible for providing network services (access

to the network) to the user.

Application Layer 7

Page 47: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

47Application Layer Contains protocols that are often

needed by users, such as HTTP.

The application layer is the most abstract layer and is closest to the user.

The user is most likely to interact with the application layer than any other layer in the model.

Page 48: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

48Application Layer Provided services:

network virtual terminal to logon to a remote host

file transfer, access and mgmnt access to a remote host to make changes and read

data retrieve/send files from/to a remote host

mail services for e-mail forwarding and storage

directory services database access for global info about services etc.

network news

Page 49: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

49

Summary of layers !

Page 50: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

50

The OSI Reference Model

This is the “International Standards Organization Open Systems Interconnection Reference Model”, or the ISO OSI Reference Model.

We will call it the OSI model.

There is a protocol defined for each layer by the ISO.

The protocols are rarely used anymore, but the model is very relevant.

Page 51: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

51Principles behind the model.

1. • Layers should be created where abstraction is needed.

2. • Each layer should perform a well-defined function.

3. • The function of the layer should be chosen while defining protocols.

4. • The layer boundaries should be chosen to minimize the information flow across the interfaces.

5. • There should not be too many or too few layers.

Page 52: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

52

OSI The OSI itself is not a network

architecture because it does not specify exact services and protocols to be used in each layer.

It just tells what each layer should do

However ISO produced standards for all the layers, although these are not part of the reference model itself

Page 53: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

53

Reference Models.The OSI reference model.

Page 54: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

54

Page 55: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

55

2-4 TCP/IP 2-4 TCP/IP PROTOCOLPROTOCOL SUITE (Internet Model) SUITE (Internet Model)

•The The layerslayers in the in the TCP/IPTCP/IP protocol suite protocol suite do notdo not exactly exactly matchmatch those in the OSI model. those in the OSI model. •The The original TCP/IP protocol suiteoriginal TCP/IP protocol suite was defined as was defined as having four layers: having four layers: host-to-networkhost-to-network, , internetinternet, , transporttransport, , and and applicationapplication. . •However, when TCP/IP is compared to OSI, we can say However, when TCP/IP is compared to OSI, we can say that the TCP/IP protocol suite is made of that the TCP/IP protocol suite is made of five layersfive layers: : physicalphysical, , data linkdata link, , networknetwork, , transporttransport, and , and applicationapplication..

Physical and Data Link LayersNetwork LayerTransport LayerApplication Layer

Topics discussed in this section:Topics discussed in this section:

Page 56: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

56The TCP/IP Reference Model

– the model itself is not much use but the protocols are widely used

This data communication model was first defined in 1974 when the internet was still part of ARPANET.

Major Goals: The Army-driven design was meant to allow the computer

network to communicate even if a part of the network was down.

This would allow the network to continue to work in the case of a war.

The military was also worried about lost connections. They did not want a connection to die as long as the

source and destination machines were alive, even if some of the machines in the middle were lost.

•This put further requirements on any protocol that might be created.

Page 57: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

57

The TCP/IP reference model. The host-to-network layer is undefined in this

model. They leave out all of the underlying layers, leaving the

implementation up to whoever creates the network.

The TCP/IP internet layer is similar in functionality to the OSI network layer.

Page 58: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

58

Figure 2.16 TCP/IP and OSI model p.43-44

•The first 4 layers deal with the communication between hosts.

•The 5th layer deals with the Internet services provided by various applications.

•Most of the 1st layer is handled by hardware (communication medium used, attachments of hosts to the medium).

•The rest of the 1st layer and all the 2nd layer is handled by the (Network Interface Card) NIC card in a host.

•The first 2 layers are network hardware specific, the others are work independently of the physical layer

•Layers 3 and 4 are fully implemented in the operating systems kernel on most existing systems.

Page 59: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

59

Network Modelswith approximate mapping between the two

•The first 4 layers deal with the communication between hosts.

•The 5th layer deals with the Internet services provided by various applications.

•Most of the 1st layer is handled by hardware (communication medium used, attachments of hosts to the medium).

•The rest of the 1st layer and all the 2nd layer is handled by the (Network Interface Card) NIC card in a host.

•The first 2 layers are network hardware specific, the others are work independently of the physical layer

•Layers 3 and 4 are fully implemented in the operating systems kernel on most existing systems.

Page 60: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

60Internet Layer. The requirements resulted in a complex network led to

choice of a packet-switching network based on a connectionless internetwork layer.

The Internet (Network) Layer is responsible for injecting packets into any network and have them travel to their destination.

Order of arrival is not important to the internet layer – they packets can be sorted out later by the higher layers.

The internet layer defines an official packet format for and protocol called Internet Protocol (IP).

the major issue is packet routing to avoid congestion.

Page 61: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

61Transport Layer.The transport layer is intended to allow two

machines to carry on a conversation, just like the OSI transport layer.

There are two end-to-end protocols defined for this:

– TCP (Transmission Control Protocol) reliable, byte stream connection-oriented

for application without errors – file transfer

– UDP (User Datagram Protocol) unreliable, connectionless

for applications that don’t need TCP’s sequence or flow control and wish to provide their own

used for client/server request reply queries in which prompt delivery is more important than accurate delivery,

such as a transmitting speech or video

Page 62: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

62Reference Models

Protocols and networks in the TCP/IP model initially.

The Application layer contains all of the higher-level protocols

– telnet - virtual terminal protocol– FTP – file transfer– SMTP – e-mail– DNS - Domain Name System– NNTP - Network News Transfer Protocol– HTTP - Hypertext Transfer Protocol

Page 63: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

63The TCP/IP Protocol Suite IGMP - Internet Group

Management Protocol handles multicasting

ICMP - Internet Control Message Protocol

Handles errors and control messages.

Protocol is used to forward information, primarily error messages.

To see if a computer is running, the `ping' program sends an echo request, which is part of ICMP.

ARP -Address Resolution Protocol is a protocol for mapping an Internet Protocol IP address to a physical machine address that is recognized in the local network.

For example, in IP Version 4, the most common level of IP in use today, an address is 32 bits long.

In an Ethernet LAN, however, addresses for attached devices are 48 bits

1st -2nd layer is handled by the Network Interface Card -NIC card

RARP - Reverse Address Resolution Protocol is a protocol by which a physical machine in a LAN can request to learn its IP address from a gateway server's Address Resolution Protocol (ARP) table or cache.

A network administrator creates a table in a LAN’s gateway router that maps the physical machine (addresses) into IP addresses.

Page 64: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

64Comparing OSI and TCP/IP Models

Both are: based on the concepts of a stack of

independent protocols

the layers up through transport layers provide an end-to-end network-independent transport service

the layers above transport are application-oriented users

Page 65: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

65Comparing OSI and TCP/IP Models• The differences between the TCP/IP (4 layers)

and OSI (7 layers) models.• OSI model clearly defined the distinction

between services, interfaces (specifies what the parameters are and what result to expect) and protocols, where the TCP/IP model does not.

• Protocols can easily be replaced in the OSI model (as long as it provides the offered services), but not in the TCP/IP model.

This fits in nicely with OO programming concepts as the layer (an object) hide information and has a set of methods (services) that processes outside the object can invoke

The code internal to the object is its protocol and it is not visible outside the object

Abstraction hides details of one layer from others

Page 66: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

66Comparing OSI and TCP/IP Models

• The OSI model has no biases for protocols, but the OSI model was overly general and did not help with the creation of new protocols.

• OSI supports: connectionless and connection-oriented in the

network layer, but only connection-oriented in the transport layer,

providing no choice to the user.

• TCP/IP supports: only connectionless in the network layer, but both in the transport layer, giving user a

choice (TCP, UDP).

Page 67: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

67Comparing OSI and TCP/IP Models

The OSI reference model was devised before the corresponding protocols were invented

With TCP/IP the protocols came first, and the model was just a description of the existing protocols

So protocols fit perfectly

Page 68: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

68A Critique of the OSI Model and Protocols

Why OSI did not take over the world

Bad timing Competing TCP/IP was already there

Bad technology 7 layers choice more political than technical,

layer 5 and 6 nearly empty, 2 and 3 are overfull Functions: addressing, flow control, error control

are in each layer instead error control must be done in

the highest layer Bad implementations

Initially because of the enormous complexity

In contrast TCP/IP was part of Berkeley UNIX and free

Bad politics

Page 69: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

69

Bad Timing

The apocalypse of the two elephants.

Page 70: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

70A Critique of the Models and Protocols

• OSI1. – Arrived late on the scene2. – Model was too complex and the protocols were flawed 3. (some stuff appears in multiple levels)4. – Poor implementation (no good example)5. – Poorly marketed

• TCP/IP1. – model is just an explanation of what was already

implemented2. – model is not useful for describing any other

protocol3. – model does not clearly define layers4. – model is not complete5. – lead to the introduction of other poorly implemented

protocols

Page 71: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

71A Critique of the TCP/IP Reference Model

Problems:1. Service, interface, and protocol not

distinguished what is required by good software engineering practice to

distinguish between the specification and the implementation

2. Not a general model3. Host-to-network “layer” not really a layer

• in the normal sense of the term as used in the context of layered protocols

• It is an interface between layer 2 and 3

4. Doesn’t distinguish the physical and data link layers.

These are completely different. They are not a separate layers.

5. Minor protocols deeply firmly established (entrenched), hard to replace

Page 72: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

72A Critique of the Models and Protocols.

In summaryOSI – The model, minus the session and

presentation layers, is exceptionally useful.

TCP/IP – The protocol is in wide use and is accepted

virtually everywhere.

The Rest of the Course:• Focus on the useful layers of the OSI model while

ignoring the ISO protocols.

Page 73: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

73

Hybrid Model

The hybrid reference model to be used in this book

Page 74: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

74

2-5 ADDRESSING2-5 ADDRESSING

Four levels of addresses are used in an internet Four levels of addresses are used in an internet employing the TCP/IP protocols: employing the TCP/IP protocols: physicalphysical, , logicallogical, , portport, , and and specificspecific..

Physical AddressesLogical AddressesPort AddressesSpecific Addresses

Topics discussed in this section:Topics discussed in this section:

Page 75: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

75

Figure 2.17 Addresses in TCP/IP

Page 76: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

76

Figure 2.18 Relationship of layers and addresses in TCP/IP

e.g. URLUniversal Resource Locator

Page 77: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

77

Figure 2.19 Physical addresses

•In Figure 2.19 a node with physical address 10 sends a frame to a node with physical address 87. •The two nodes are connected by a link (bus topology LAN). •As the figure shows, the computer with physical address 10 is the sender, and the computer with physical address 87 is the receiver.

Page 78: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

78

Most local-area networks use a 48-bit (6-byte) physical address (or MAC addresses) written as 12 hexadecimal digits; every byte (2 hexadecimal digits) is separated by a colon, as shown below:

Example 2.2

07:01:02:01:2C:4B

A 6-byte (12 hexadecimal digits) physical address.

Page 79: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

79Wide Area Networks

Relation between hosts on LANs and the subnet. The subnet consists of routers and

transmission lines. A router is a specialized piece of switching hardware

that is responsible for determining the direction that data packets should be sent.

Routers are responsible for directing data down transmission lines from one LAN to another.

Page 80: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

80Wide Area Networks

A stream of packets from sender to receiver. A subnet is organized according to the principle called Store-

and-forward or Packet-switched subnet– The message is broken down into smaller packets to send.– Each packet is sent out onto the network.– As a packet arrives at a router, it is stored there until the outgoing line

is free. It is then sent on it’s way.– All the packets make take the same or different routes depending on if

they are individually routed or not.

Page 81: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

81

Figure 2.20 IP addresses

•Figure 2.20 shows a part of an internet with two routers connecting three LANs. •Each device (computer or router) has a pair of addresses (logical and physical) for each connection. •In this case, each computer is connected to only one link and therefore has only one pair of addresses. •Each router, however, is connected to 3 networks (only two are shown in the figure).

•So each router has 3 pairs of addresses, one for each connection.

Page 82: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

82

Figure 2.21 Port addresses

•Figure 2.21 shows two computers communicating via the Internet. •The sending computer is running three processes at this time with port addresses a, b, and c. •The receiving computer is running two processes at this time with port addresses j and k. •Process a in the sending computer needs to communicate with process j in the receiving computer. •Note that although physical addresses change from hop to hop, logical and port addresses remain the same from the source to destination.

Page 83: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

83

Example 2.5

As we will see in Chapter 23, a port address is a 16-bit (2 byte) address represented by one decimal number as shown.

753A 16-bit port address represented

as one single number.

Page 84: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

84

The physical addresses change from hop to hop,but the logical and port addresses usually remain the same.

Note

Page 85: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

85

SummaryThe physical layer is responsible for transmitting a bit stream over a physicalmedium. It is concerned with

a. physical characteristics of the mediab. representation of bitsc. type of encodingd. synchronization of bitse. transmission rate and modef. the way devices are connected with each other and to the links

The data link layer is responsible fora. framing data bitsb. providing the physical addresses of the sender/receiverc. data rate controld. detection and correction of damaged and lost frames

The network layer is concerned with delivery of a packet across multiple networks;therefore its responsibilities include

a. providing host-to-host addressingb. Routing

The transport layer oversees the process-to-process delivery of the entire message.It is responsible for

a. dividing the message into manageable segmentsb. reassembling it at the destination,c. flow and error control

The application layer services include, file transfer, remote access, shared databasemanagement, and mail services

Page 86: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

86

SummaryAddresses

The physical address is the local address of a node; it is used by the data link layer to deliver data from one node to another within the same network.

The logical address defines the sender and receiver at the network layer and is used to deliver messages across multiple networks.

The port address (service-point) identifies the application

process on the station.

The application layer services include file transfer, remote access, shared database management, and mail services

The application, presentation, and session layers of the OSI model are represented by the application layer in the Internet model.

The lowest four layers of OSI correspond to the Internet model layers.

Page 87: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

87Physical Mail

Secretary X

Mail Room X

Postman X

Post office X

CEO X

Secretary Y

Mail Room Y

Postman Y

Post office Y

CEO Y“Lunch?”

“Lunch?”

“Lunch?”

“Lunch?”

“Lunch?”

Page 88: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

88Protocol interfaces

e-mail client

TCP server

IP server

ethernetdriver/card

user X

e-mail server

TCP server

IP server

ethernetdriver/card

user Y

s = open_socket();socket_write(s, buffer);…

Page 89: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

89Protocol stack:packet forwarding

HTTP

TCP

IP

ethernet

Host A

IP

ethernet

Router R

link

HTTP

TCP

IP

ethernet

Router W

Host B

IP

ethernetlink

Page 90: Jozef Goetz, 2008 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. expanded by Jozef Goetz, 2008

Jozef Goetz, 2008

90

OSI units

Address Layer Data Unit Delivery7 ApplicationLayer Messages6 PresentationLayer Messages5 SessionLayer Messages

port #'s 4 TransportLayer TCP Segments, UDP diagrams Process To Process //End to Endlog.address IP 3 NetworkLayer Packet/Datagram Source Host to Destination HostMAC phAddress 2 DataLinkLayer Frames Point to Point //Hop to Hop

1 PhysicalLayer