Netprog: OSI Reference Model

50
1 Netprog: OSI Reference Model Networking Networking

Transcript of Netprog: OSI Reference Model

Page 1: Netprog: OSI Reference Model

1Netprog: OSI Reference Model

NetworkingNetworking

Page 2: Netprog: OSI Reference Model

2Netprog: OSI Reference Model

NetworkNetwork

“ “ ... communication system for connecting ... communication system for connecting end-systems”end-systems”

End-systems a.k.a. “hosts”End-systems a.k.a. “hosts”

PCs, workstationsPCs, workstations

dedicated computersdedicated computers

network components network components

Page 3: Netprog: OSI Reference Model

3Netprog: OSI Reference Model

Multiaccess vs. Point-to-pointMultiaccess vs. Point-to-point

Multiaccess means shared medium.Multiaccess means shared medium.– many end-systems share the same physical many end-systems share the same physical

communication resources (communication resources (wire, frequency, ...)wire, frequency, ...)– There must be some arbitration mechanism.There must be some arbitration mechanism.

Point-to-pointPoint-to-point– only 2 systems involvedonly 2 systems involved– no doubt about where data came from !no doubt about where data came from !

Page 4: Netprog: OSI Reference Model

4Netprog: OSI Reference Model

MultiaccessMultiaccess Point-to-pointPoint-to-point

Page 5: Netprog: OSI Reference Model

5Netprog: OSI Reference Model

LAN - Local Area NetworkLAN - Local Area Network

connects computers that are physically connects computers that are physically close together ( < 1 mile).close together ( < 1 mile).– high speedhigh speed– multi-accessmulti-access

Technologies:Technologies:– EthernetEthernet 10 Mbps, 100Mbps10 Mbps, 100Mbps– Token RingToken Ring16 Mbps16 Mbps– FDDI FDDI 100 Mbps100 Mbps

Page 6: Netprog: OSI Reference Model

6Netprog: OSI Reference Model

WAN - Wide Area NetworkWAN - Wide Area Network

connects computers that are physically connects computers that are physically far apart. “long-haul network”.far apart. “long-haul network”.– typically slower than a LAN.typically slower than a LAN.– typically less reliable than a LAN.typically less reliable than a LAN.– point-to-pointpoint-to-point

Technologies:Technologies:– telephone linestelephone lines– Satellite communicationsSatellite communications

Page 7: Netprog: OSI Reference Model

7Netprog: OSI Reference Model

MAN - Metropolitan Area MAN - Metropolitan Area NetworkNetwork

Larger than a LAN and smaller than a Larger than a LAN and smaller than a WANWAN- example: campus-wide network- example: campus-wide network

- multi-access network- multi-access network Technologies:Technologies:

– coaxial cable coaxial cable – microwavemicrowave

Page 8: Netprog: OSI Reference Model

8Netprog: OSI Reference Model

InternetworkInternetwork Connection of 2 or more distinct Connection of 2 or more distinct

(possibly dissimilar) networks.(possibly dissimilar) networks. Requires some kind of network device Requires some kind of network device

to facilitate the connection.to facilitate the connection.

Net A Net B

Page 9: Netprog: OSI Reference Model

9Netprog: OSI Reference Model

OSI Reference ModelOSI Reference Model

Layered model:Layered model:7. Application7. Application

6. Presentation6. Presentation

5. Session5. Session

4. Transport4. Transport

3. Network3. Network

2. Data Link2. Data Link

1. Physical1. Physical

Page 10: Netprog: OSI Reference Model

10Netprog: OSI Reference Model

The Physical LayerThe Physical Layer

Responsibility:Responsibility:– transmission of raw bits over a transmission of raw bits over a

communication channel.communication channel. Issues:Issues:

– mechanical and electrical interfacesmechanical and electrical interfaces– time per bittime per bit– distancesdistances

Page 11: Netprog: OSI Reference Model

11Netprog: OSI Reference Model

The Data Link Layer - The Data Link Layer - Data Link ControlData Link Control

Responsibility:Responsibility:– provide an error-free communication linkprovide an error-free communication link

Issues:Issues:– framing framing (dividing data into chunks)(dividing data into chunks)

» header & trailer bitsheader & trailer bits

– addressingaddressing

10110110101 01100010011 10110000001

Page 12: Netprog: OSI Reference Model

12Netprog: OSI Reference Model

The Data Link Layer - The Data Link Layer - The MAC sublayerThe MAC sublayer

Medium Access Control - needed by Medium Access Control - needed by mutiaccess networks.mutiaccess networks.

MAC provides DLC with “virtual wires” MAC provides DLC with “virtual wires” on multiaccess networks.on multiaccess networks.

Page 13: Netprog: OSI Reference Model

13Netprog: OSI Reference Model

The Network LayerThe Network Layer

Responsibilities:Responsibilities:– path selection between end-systems (routing).path selection between end-systems (routing).– subnet flow control.subnet flow control.– fragmentation & reassemblyfragmentation & reassembly– translation between different network types.translation between different network types.

Issues:Issues:– packetpacket headers headers– virtual circuitsvirtual circuits

Page 14: Netprog: OSI Reference Model

14Netprog: OSI Reference Model

The Transport LayerThe Transport Layer Responsibilities:Responsibilities:

– provides virtual end-to-end links between provides virtual end-to-end links between peer processes.peer processes.

– end-to-end flow controlend-to-end flow control Issues:Issues:

– headersheaders– error detection error detection – reliable communicationreliable communication

Page 15: Netprog: OSI Reference Model

15Netprog: OSI Reference Model

The Session LayerThe Session Layer

Responsibilities:Responsibilities:– establishes, manages, and terminates establishes, manages, and terminates

sessions between applications.sessions between applications.– service location lookupservice location lookup

Many protocol suites do not include a Many protocol suites do not include a session layer.session layer.

Page 16: Netprog: OSI Reference Model

16Netprog: OSI Reference Model

The Presentation LayerThe Presentation Layer

Responsibilities:Responsibilities:– data encryptiondata encryption– data compressiondata compression– data conversiondata conversion

Many protocol suites do not include a Many protocol suites do not include a Presentation Layer.Presentation Layer.

Page 17: Netprog: OSI Reference Model

17Netprog: OSI Reference Model

The Application LayerThe Application Layer

Responsibilities:Responsibilities:– anything not provided by any of the other anything not provided by any of the other

layerslayers Issues:Issues:

– application level protocolsapplication level protocols– appropriate selection of “type of service”appropriate selection of “type of service”

Page 18: Netprog: OSI Reference Model

18Netprog: OSI Reference Model

Layering & Headers Layering & Headers Each layer needs to add some control Each layer needs to add some control

information to the data in order to do it’s job. information to the data in order to do it’s job. This information is typically prepended to This information is typically prepended to

the data before being given to the lower the data before being given to the lower layer.layer.

Once the lower layers deliver the the data Once the lower layers deliver the the data and control information - the peer layer uses and control information - the peer layer uses the control information.the control information.

Page 19: Netprog: OSI Reference Model

19Netprog: OSI Reference Model

HeadersHeaders

Process

Transport

Network

Data Link

Process

Transport

Network

Data Link

DATA

DATA

DATA

DATA

H

H

H

H

HH

Page 20: Netprog: OSI Reference Model

20Netprog: OSI Reference Model

What are the headers?What are the headers?

PhysicalPhysical: no header - just a bunch of bits.: no header - just a bunch of bits.

Data Link:Data Link: – address of the receiving endpointsaddress of the receiving endpoints– address of the sending endpointaddress of the sending endpoint– length of the datalength of the data– checksum.checksum.

Page 21: Netprog: OSI Reference Model

21Netprog: OSI Reference Model

Network layer header - Network layer header - examplesexamples

protocol suite protocol suite versionversion

type of service type of service length of the datalength of the data packet identifierpacket identifier fragment numberfragment number time to livetime to live

protocolprotocol header checksumheader checksum source network source network

addressaddress destination network destination network

addressaddress

Page 22: Netprog: OSI Reference Model

22Netprog: OSI Reference Model

Important SummaryImportant Summary

Data-Link: communication between Data-Link: communication between machines on the same network.machines on the same network.

Network: communication between Network: communication between machines on possibly different machines on possibly different networks.networks.

Transport: communication between Transport: communication between processes (running on machines on processes (running on machines on possibly different networks).possibly different networks).

Page 23: Netprog: OSI Reference Model

23Netprog: OSI Reference Model

Connecting NetworksConnecting Networks

Repeater: Repeater: physical layerphysical layer

Bridge: Bridge: data link layerdata link layer

Router: Router: network layernetwork layer

Gateway: Gateway: network layer and network layer and

above.above.

Page 24: Netprog: OSI Reference Model

24Netprog: OSI Reference Model

RepeaterRepeater

Copies bits from one network to anotherCopies bits from one network to another Does not look at any bitsDoes not look at any bits Allows the extension of a network Allows the extension of a network

beyond physical length limitationsbeyond physical length limitations

REPEATER

Page 25: Netprog: OSI Reference Model

25Netprog: OSI Reference Model

BridgeBridge Copies frames from one network to anotherCopies frames from one network to another Can operate selectively - does not copy all frames Can operate selectively - does not copy all frames

(must look at data-link headers).(must look at data-link headers). Extends the network beyond physical length Extends the network beyond physical length

limitations.limitations.

BRIDGE

Page 26: Netprog: OSI Reference Model

26Netprog: OSI Reference Model

RouterRouter Copies packets from one network to another.Copies packets from one network to another. Makes decisions about what Makes decisions about what routeroute a packet a packet

should take (looks at network headers).should take (looks at network headers).

ROUTERROUTER

Page 27: Netprog: OSI Reference Model

27Netprog: OSI Reference Model

GatewayGateway

Operates as a routerOperates as a router Data conversions above the network Data conversions above the network

layer.layer. Conversions:Conversions:

encapsulation - use an intermediate network encapsulation - use an intermediate network

translation - connect different application translation - connect different application protocolsprotocols

encrpyption - could be done by a gatewayencrpyption - could be done by a gateway

Page 28: Netprog: OSI Reference Model

28Netprog: OSI Reference Model

Encapsulation ExampleEncapsulation Example

Gateway Gateway

Provides service connectivity even Provides service connectivity even though intermediate network does though intermediate network does not support protocols.not support protocols.

Page 29: Netprog: OSI Reference Model

29Netprog: OSI Reference Model

TranslationTranslation

Translate from green protocol to brown Translate from green protocol to brown protocolprotocol

Gateway

Page 30: Netprog: OSI Reference Model

30Netprog: OSI Reference Model

Encryption gatewayEncryption gateway

Encryption/DecryptionGateways

SecureNetwork

Secure Network

GWGW ??

?

Insecure Network

Page 31: Netprog: OSI Reference Model

31Netprog: OSI Reference Model

Hardware vs. SoftwareHardware vs. Software

Repeaters are typically hardware devices.Repeaters are typically hardware devices. Bridges can be implemented in hardware or Bridges can be implemented in hardware or

software.software. Routers & Gateways are typically Routers & Gateways are typically

implemented in software so that they can be implemented in software so that they can be extended to handle new protocols.extended to handle new protocols.

Many workstations can operate as routers or Many workstations can operate as routers or gateways. gateways.

Page 32: Netprog: OSI Reference Model

32Netprog: OSI Reference Model

Byte OrderingByte Ordering

Different computer architectures use Different computer architectures use different byte ordering to represent different byte ordering to represent multibyte values.multibyte values.

16 bit integer:16 bit integer:

Low Byte

High Byte

High Byte

Low Byte

Address AAddress A

Address A+1Address A+1

Page 33: Netprog: OSI Reference Model

33Netprog: OSI Reference Model

Byte OrderingByte Ordering

Low ByteHigh Byte

Addr A Addr A+1

High ByteLow Byte

Addr A Addr A+1

Big-EndianBig-Endian

IBM 370IBM 370

Motorola 68000Motorola 68000

SunSun

Little-EndianLittle-Endian

IBM 80x86IBM 80x86

DEC VAXDEC VAX

DEC PDP-11DEC PDP-11

Page 34: Netprog: OSI Reference Model

34Netprog: OSI Reference Model

Byte Order and NetworkingByte Order and Networking

Suppose a Big Endian machine sends a Suppose a Big Endian machine sends a 16 bit integer with the value 2:16 bit integer with the value 2:

A Little Endian machine will think it got A Little Endian machine will think it got the number 512:the number 512:

0000000000000010

0000001000000000

Page 35: Netprog: OSI Reference Model

35Netprog: OSI Reference Model

Network Byte OrderNetwork Byte Order

Conversion of application-level data is Conversion of application-level data is left up to the presentation layer.left up to the presentation layer.

But hold on !!! How do lower level layers But hold on !!! How do lower level layers communicate if they all represent values communicate if they all represent values differently ? (data length fields in differently ? (data length fields in headers)headers)

A fixed byte order is used (called A fixed byte order is used (called network byte ordernetwork byte order) for all control data.) for all control data.

Page 36: Netprog: OSI Reference Model

36Netprog: OSI Reference Model

MultiplexingMultiplexing

““.. to combine many into one”. .. to combine many into one”. Many processes sharing a single Many processes sharing a single

network interface.network interface. A single process could use multiple A single process could use multiple

protocols.protocols. More on this when we look at TCP/IP.More on this when we look at TCP/IP.

Page 37: Netprog: OSI Reference Model

37Netprog: OSI Reference Model

Modes of ServiceModes of Service

connection-oriented vs. connectionlessconnection-oriented vs. connectionless sequencingsequencing error-controlerror-control flow-controlflow-control byte stream vs. message basedbyte stream vs. message based full-duplex vs. half-duplex.full-duplex vs. half-duplex.

Page 38: Netprog: OSI Reference Model

38Netprog: OSI Reference Model

Connection-Oriented vs. Connection-Oriented vs. Connectionless ServiceConnectionless Service

A connection-oriented service includes A connection-oriented service includes the establishment of a logical the establishment of a logical connection between 2 processes.connection between 2 processes.– establish logical connectionestablish logical connection– transfer datatransfer data– terminate connection.terminate connection.

Connectionless services involve Connectionless services involve sending of independent messages.sending of independent messages.

Page 39: Netprog: OSI Reference Model

39Netprog: OSI Reference Model

SequencingSequencing

Sequencing provides support for an Sequencing provides support for an order to communications.order to communications.

A service that includes sequencing A service that includes sequencing requires that messages (or bytes) are requires that messages (or bytes) are received in the same order they are received in the same order they are sent.sent.

Page 40: Netprog: OSI Reference Model

40Netprog: OSI Reference Model

Error ControlError Control

Some services require error detection (it Some services require error detection (it is important to know when a is important to know when a transmission error has occured).transmission error has occured).

Checksums provide a simple error Checksums provide a simple error detection mechanism.detection mechanism.

Error control sometimes involves Error control sometimes involves notification and retransmission.notification and retransmission.

Page 41: Netprog: OSI Reference Model

41Netprog: OSI Reference Model

Flow ControlFlow Control

Flow control prevents the sending Flow control prevents the sending process from overwhelming the process from overwhelming the receiving process.receiving process.

Flow control can be handled a variety of Flow control can be handled a variety of ways - this is one of the major research ways - this is one of the major research issues in the development of the next issues in the development of the next generation of networks (ATM).generation of networks (ATM).

Page 42: Netprog: OSI Reference Model

42Netprog: OSI Reference Model

Byte Stream vs. MessageByte Stream vs. Message

Byte stream implies an ordered Byte stream implies an ordered sequence of bytes with no message sequence of bytes with no message boundaries.boundaries.

Message oriented services provide Message oriented services provide communication service to chunks of communication service to chunks of data called datagrams. data called datagrams.

Page 43: Netprog: OSI Reference Model

43Netprog: OSI Reference Model

Full- vs. Half-DuplexFull- vs. Half-Duplex

Full-Duplex services support the Full-Duplex services support the transfer of data in both directions.transfer of data in both directions.

Half-Duplex services support the Half-Duplex services support the transfer of data in a single direction.transfer of data in a single direction.

Page 44: Netprog: OSI Reference Model

44Netprog: OSI Reference Model

End-to-End vs. Hop-toHopEnd-to-End vs. Hop-toHop

Many service modes/features such as Many service modes/features such as flow control and error control can be flow control and error control can be done either:done either:

between endpoints of the communication.between endpoints of the communication.

-or--or-

between every 2 nodes on the path between between every 2 nodes on the path between the endpoints.the endpoints.

Page 45: Netprog: OSI Reference Model

45Netprog: OSI Reference Model

End-to-EndEnd-to-End

Process A

Process B

Page 46: Netprog: OSI Reference Model

46Netprog: OSI Reference Model

Hop-by-HopHop-by-Hop

Process A

Process B

Page 47: Netprog: OSI Reference Model

47Netprog: OSI Reference Model

BufferingBuffering

Buffering can provide more efficient communications. Buffering can provide more efficient communications. Buffering is most useful for byte stream services.Buffering is most useful for byte stream services.

Process A Process BSendBuffer

Recv.Buffer

Page 48: Netprog: OSI Reference Model

48Netprog: OSI Reference Model

AddressesAddresses

Each communication endpoint must Each communication endpoint must have an address.have an address.

Consider 2 processes communicating Consider 2 processes communicating over an internet:over an internet:– the network must be specifiedthe network must be specified– the host (end-system) must be specifiedthe host (end-system) must be specified– the process must be specified.the process must be specified.

Page 49: Netprog: OSI Reference Model

49Netprog: OSI Reference Model

Addresses at LayersAddresses at Layers

Physical Layer: no address necessaryPhysical Layer: no address necessary Data Link Layer - address must be able Data Link Layer - address must be able

to select any host on the network.to select any host on the network. Network Layer - address must be able Network Layer - address must be able

to provide information to enable routing.to provide information to enable routing. Transport Layer - address must identify Transport Layer - address must identify

the destination process.the destination process.

Page 50: Netprog: OSI Reference Model

50Netprog: OSI Reference Model

BroadcastsBroadcasts

Many networks support the notion of Many networks support the notion of sending a message from one host to all sending a message from one host to all other hosts on the network.other hosts on the network.

A special address called the “broadcast A special address called the “broadcast address” is often used.address” is often used.

Some popular network services are Some popular network services are based on broadcasting (YP/NIS, rup, based on broadcasting (YP/NIS, rup, rusers)rusers)