Computer Networks

177
Network Architecture Open Systems Interconnection Reference Model

description

Includes OSI model, Switches, Ethernet, Hubs, LAN, and other COmputer Network Syllabus of Anna university

Transcript of Computer Networks

Page 1: Computer Networks

Network Architecture

Open Systems Interconnection Reference Model

Page 2: Computer Networks

Objectives

• Identify organizations that set standards for networking

• Describe the purpose of the OSI Model and each of its layers

• Explain specific functions belonging to each OSI Model layer

Page 3: Computer Networks

Objectives (continued)

• Understand how two network nodes communicate through the OSI model

• Discuss the structure and purpose of data packets and frames

• Describe the two types of addressing covered by the OSI Model

Page 4: Computer Networks

Networking Standards Organizations

• Standards: documented agreements containing technical specifications or other precise criteria stipulating how particular products or services should be designed or performed– Define minimum acceptable performance

• Many different organizations have evolved to oversee computer industry’s standards

• Ensures the interconnectivity and compatibility of the device

• Help in maintaining market competitiveness and guarantees interoperability

Page 5: Computer Networks

ANSI

• American National Standards Institute (ANSI)– Composed of more than a thousand representatives

from industry and government– Represents United States in setting international

standards

• ANSI standards documents available: – ANSI’s Web site (www.ansi.org)– At university or public libraries

Page 6: Computer Networks

IEEE

• Institute of Electrical and Electronics Engineers• International society composed of engineering

professionals • Goals are to promote development and education in

electrical engineering and computer science• IEEE technical papers and standards are highly

respected in the networking profession– Can purchase IEEE documents online from IEEE’s

Web site (www.ieee.org)

Page 7: Computer Networks
Page 8: Computer Networks
Page 9: Computer Networks

ISO

• International Organization for Standardization• Collection of organization standards representing

146 countries• Goal is to establish international technological

standards to facilitate global exchange of information and barrier-free trade

• Fewer than 300 of ISO’s more than 14,250 standards apply to computer-related products and functions

Page 10: Computer Networks

10

Why Architecture?

Offer interoperability across diverse networksAllow for easier application codingAllow providers to competeFacilitate innovation

Page 11: Computer Networks

Copyright by Jorg Liebeherr 98, 99

Network Architecture

• A Network Architecture is a structured set of protocols that implement the exchange of information between computers

Page 12: Computer Networks

Copyright by Jorg Liebeherr 98, 99

Protocol Architectures

• There are only few protocol architectures that are relevant today:– OSI Reference Model

– TCP/IP Protocols Suite

– ATM Protocol Stack

Page 13: Computer Networks

OSI Model

• Open Systems Interconnection (OSI) Model: divides network communications into seven layers:– Physical, Data Link, Network, Transport, Session,

Presentation, and Application

• Protocols perform services unique to layer• Protocols interact with protocols in layers

directly above and below• Protocol: set of instructions to perform a

function or group of functions– Written by a programmer

Page 14: Computer Networks

TCP/IP Protocol Suite 14

Figure 2.3 The OSI model

Page 15: Computer Networks

TCP/IP Protocol Suite 15

Figure 2.4 OSI layers

Page 16: Computer Networks

The OSI Model (continued)• Theoretical representation of what happens between

two nodes communicating on a network

– Model for understanding and designing a network architecture

– Does not prescribe type of hardware or software that should support each layer

– Does not describe how software programs interact with other software programs or how software programs interact with humans

– Provides standards for communication between systems

• Each layer communicates with same layer from one computer to another

Page 17: Computer Networks

The OSI Model (continued)

Figure 2-1: Flow of data through the OSI Model

Page 18: Computer Networks
Page 19: Computer Networks

Tip to remember

• All People Seem To Need Data Processing.• Please Do Not Tell Secret Passwords

Anytime. • Please Do Not Throw Sausage Pizza Away.

Page 20: Computer Networks
Page 21: Computer Networks
Page 22: Computer Networks

Application layer• Responsible for accessing the network by user. It provides user

interfaces and other supporting services such as email, remote file access, file transfer, sharing database, message handling and directory services.

• Function of application layer

1. Network virtual terminal

It is a software version of physical terminal that allows a user to log on to a remote host

2. File transfer, Access and Management(FTAM)

allows user to access files in remote hosts, to retrieve files and to manage files in remote computer.

3. Mail services

email forwarding, storage under this category

4. Directory services: include access for global information and distributed database.

Page 23: Computer Networks

Application Layer (7)• Hypertext Transfer Protocol (HTTP): formats

and sends requests from client’s browser to server– Also formats and sends Web server’s response back

to client’s browser

• Application program interface (API): set of routines that make up part of a software application

Page 24: Computer Networks

Presentation Layer (6)

• Deals with syntax and semantics of information being exchanged

• Protocols accept Application layer data and format it – So that one type of application and host can

understand data from another type of application and host

• e.g., translation and conversion between graphics file types

• Manages data encryption and decryption

Page 25: Computer Networks

Presentation layer(contd..)

• Responsible:

1.Translation

Different computers use different encoding systems. so this layer maintains interoperability between the two encoding systems

2. Encryption

encryption is transforming sender information to other form to ensure privacy while transmission.Decrytion is reverse process.

3. Compression

compression is a technique of reducing number of bits required to represent the data

Page 26: Computer Networks

Session Layer (5)

• Protocols coordinate and maintain communications between two network nodes– Establish and maintain communications link for

duration of session – Keep communication secure– Synchronize dialogue between two nodes Network dialog controller…it establishes and synchronizes the

interaction b/w communication system

– Determine if communications have been cut off• Determine where to restart transmission

– Terminate communications

Page 27: Computer Networks

Session Layer (continued)• Sets terms of communication

– Decides which node will communicate first– Decides how long a node can communicate

• Monitors identification of session participants– Ensures that only authorized nodes have access

Responsibities:1. Dialog control

communication between two processes take place in either half duplex or full duplexmode.Manages dialog control for this communication

2. synchronization: layer adds synchronization points into stream of data

Page 28: Computer Networks

Transport Layer (4)

• Responsible for delivery of message from one process to another

• Protocols accept data from Session layer and manage end-to-end delivery of data– Ensure data transferred reliably, in correct sequence, and

without errors• Protocols also handle flow control as well as error control

– Gauging appropriate rate of transmission based on how fast recipient can accept data

• Transmission Control Protocol (TCP): Takes care of reliably transmitting HTTP requests from client to server and vice versa

Page 29: Computer Networks

Transport Layer (continued)

• Connection-oriented protocols: ensure that data arrives exactly as it was sent– Establish connection before transmitting data– TCP is connection-oriented

• Client’s TCP protocol first sends synchronization (SYN) packet request to server

• Server responds with synchronization-acknowledgment (SYN-ACK) packet

• Client responds with own acknowledgment (ACK)

Page 30: Computer Networks

Transport Layer (continued)

• Acknowledgments also used to ensure that data was properly delivered– For every data unit sent, connection-oriented protocol expects

acknowledgment from recipient

• If no acknowledgment, data retransmitted• Connection-oriented protocols use a checksum

– Unique character string allowing receiving node to determine if arriving data unit exactly matches data unit sent by source

Page 31: Computer Networks

Transport Layer (continued)

• Connectionless protocols do not establish connection before transmitting – No effort to ensure data delivered error-free

• Transport layer protocols break large data units received from Session layer into smaller segments (segmentation)

Page 32: Computer Networks

Transport Layer

• Reassembly: process of reconstructing segmented data units

• Sequencing: method of identifying segments that belong to same group of subdivided data– Indicates where unit of data begins– Indicates order in which groups of data were issued– Transport layer protocols of two nodes must

synchronize timing and agree on starting point for the transmission

Page 33: Computer Networks

Network layer• Responsible for the delivery of packets from

the source to destination.• Functions :1. Logical addressing

Data link layer implements physical addressing , when packet passes network boundary, an addressing system is needed to differentiate source and destination. The network layer adds a header to the packet of upper layer includes the logical addresses of header and receiver.

2. Routing

Route or switch the packets to its final destination in an internetwork

Page 34: Computer Networks

Network Layer (continued)

Figure 2-2: Segmentation and Reassembly

Page 35: Computer Networks
Page 36: Computer Networks

Network Layer Devices

Routers

Brouters

Layer 3 Switches

Page 37: Computer Networks

Network Layer

• Primary functions of protocols:– Translate network addresses into physical

counterparts– Decide how to route data from sender to receiver

• Each node has two types of addresses:– Network address: follows hierarchical addressing

scheme • Can be assigned through OS software• Network layer addresses, logical addresses, or

virtual addresses– Physical address

Page 38: Computer Networks

Network Layer (continued)

• Network layer protocols accept Transport layer segments and add logical addressing information in network header

• Network layer handles routing– Determining best network path

• Fragmentation: Network layer protocol subdivides segments it receives from Transport layer into smaller packets

Page 39: Computer Networks

Data Link Layer

• Protocols divide received data into distinct frames – Can then be transmitted by Physical layer

• Frame: structured package for moving data – Raw data

• “payload” – Sender’s and receiver’s network addresses– Error checking and control information

Page 40: Computer Networks

Data Link Layer (continued)

• Error checking accomplished by 4-byte Frame Check Sequence (FCS) field– Ensures data at destination exactly matches data

issued from source– When source node transmits data, performs Cyclic

Redundancy Check (CRC) to get FCS– Destination node’s Data Link layer services

unscramble FCS via same CRC algorithm

• Data Link layer divided into two sub-layers:– Logical Link Control – Media Access Control

Page 41: Computer Networks

Data Link Layer (continued)

Figure 2-5: The Data Link layer and its sublayers

Page 42: Computer Networks

Data Link Layer (continued)

• Logical Link Control (LLC) sublayer: – Provides interface to Network layer protocols– Manages flow control– Issues requests for transmission for data that has

suffered errors

• Media Access Control (MAC) sublayer: – Manages access to physical layer

• Appends destination computer’s physical address onto data frame (MAC address, Data Link layer address, or hardware address)

Page 43: Computer Networks

Data Link Layer Concepts

• Frame• The Hardware (MAC) Address• Logical Topology

Page 44: Computer Networks

Data Link Layer Devices

Bridges

Switches

NIC

Page 45: Computer Networks
Page 46: Computer Networks
Page 47: Computer Networks

Switchs/Hubs

Page 48: Computer Networks

Data Link Layer (continued)

Figure 2-6: A NIC’s MAC address

Page 49: Computer Networks

Data Link Layer (continued)

• MAC addresses contain two parts: – Block ID: six-character sequence unique to vendor– Device ID: six-character sequence based on NIC’s

model and manufacture date

Page 50: Computer Networks

Physical Layer

• Protocols accept frames from Data Link layer and generate voltage to transmit signals

• When receiving data, protocols detect voltage and accept signals

• Protocols also set data transmission rate and monitor data error rates – Cannot perform error correction

• NICs operate at both Physical layer and Data Link layer

• Network administrators mostly concerned with bottom four layers of OSI Model

Page 51: Computer Networks

Physical Layer Devices

NIC

Transceivers

Repeaters

Hubs

MAUs

Page 52: Computer Networks

Repeaters

Page 53: Computer Networks

Hubs

Page 54: Computer Networks

TCP/IP Protocol Suite 54

Figure 2.6 Summary of OSI Layers

Page 55: Computer Networks

TCP/IP Model

• A highly standardized protocol used widely on the Internet

• Developed by the US Defense Advanced Research Project Agency (DARPA) for its packet switched network (ARPANET)

• Standards area available in the form of RFC documents– Request For Comments (RFC)

• Standards are overseen by the Internet Engineering Task Force (IETF)

Page 56: Computer Networks

Layers of TCP/IP Reference Model

• There are four layers of the TCP/IP reference model (DARPA model as named by the US Government Agency)– The ISO-OSI reference model is composed of seven

layers

• Note that the ISO/OSI model is more widely used and accepted but the TCP/IP model is easy to comprehend

Page 57: Computer Networks

Copyright by Jorg Liebeherr 98, 99

TCP/IP Protocol Suite• The TCP/IP protocol

suite was first defined in 1974

• The TCP/IP protocol suite is the protocol architecture of the Internet

• The TCP/IP suite has four layers: Application, Transport, Internet, and Network Interface Layer

ApplicationLayer

TransportLayer

Internet

NetworkInterface

telnet, ftp, email

TCP, UDP

IP, ICMP, IGMP

Device Drivers

Page 58: Computer Networks

Copyright by Jorg Liebeherr 98, 99

Comparison of OSI Model and TCP/IP Suite

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application

Transport

Internetwork

NetworkAccess

Physical

OSI TCP/IP

Page 59: Computer Networks

OSI and TCP/IP Protocol StackOSI Model TCP/IP Hierarchy Protocols

7th

Application Layer

6th

Presentation Layer

5th

Session Layer

4th

Transport Layer

3rd

Network Layer

2nd

Link Layer

1st

Physical Layer

Application Layer

Transport Layer

Network Layer

Link Layer

Link Layer : includes device driver and network interface cardNetwork Layer : handles the movement of packets, i.e. RoutingTransport Layer : provides a reliable flow of data between two hostsApplication Layer : handles the details of the particular application

Page 60: Computer Networks

Source: TCP/IP White Paper by Microsoft

Page 61: Computer Networks

TCP/IP Layers

• Network interface layer• Internet layer• Host-to-host transport layer• Application layer

Page 62: Computer Networks

Network Interface Layer

• Responsible for sending and receiving TCP/IP packets on the network medium (physical/Data Link)

• Exchange of data between end system and network

• Applicable LAN technologies– Ethernet, Token Ring, FDDI etc.

• Applicable WAN technologies– X.25 (old), Frame Relay, ATM etc.

• Destination address provision

Page 63: Computer Networks

Internet Layer (IP)

• Systems may be attached to different networks

• Routing functions across multiple networks• Implemented in end systems and routers

Page 64: Computer Networks

Core Internet Layer Protocols

• IP– A connectionless unreliable protocol that is part of the

TCP/IP protocol suite

• ARP (Address Resolution Protocol)– Resolves IP addresses to MAC addresses

• ICMP (Internet Control Message Protocol)– Diagnostics and error reporting

• (IGMP) Internet Group Management Protocol– Management of group multicast

Page 65: Computer Networks

Transport Layer (TCP)

• Reliable delivery of data• Ordering of delivery

Page 66: Computer Networks

Transport Layer

• Sequencing and transmission of packets• Acknowledgment of receipts• Recovery of packets• Flow control• In essence, it engages in host-to-host

transportation of data packets and the delivery of them to the application layer

Page 67: Computer Networks

Core Protocols of the Transport Layer

TCP (Transmission Control Protocol)

UDP (User Datagram Protocol)

Transport Layer

Page 68: Computer Networks

TCP

• Transmission Control Protocol (TCP)• One-to-one and connection-oriented reliable

protocol• Used in the accurate transmission of large

amount of data• Slower compared to UDP because of

additional error checking being performed

Page 69: Computer Networks

UDP

• User Datagram Protocol (UDP)• One-to-one or one-to-many,connectionless and

unreliable protocol• Used for the transmission of small amount of data

– Accuracy is not of prime concern– The overhead of establishing a TCP connection is not warranted

• Used in video and audio casting– Multicasting– Broadcasting

• Also used for multimedia transmission• Faster compared to TCP

Page 70: Computer Networks

Application Layer

• Support for user applications

e.g. http, SMTP• Provides applications with the ability to

access the services of the other layers• New protocols and services are always being

developed in this category

Page 71: Computer Networks

Some Core Protocols

• HTTP• FTP• Telnet• SMTP• POP3• IMAP• SNMP etc.

Page 72: Computer Networks

Packet Encapsulation The data is sent down the protocol stack Each layer adds to the data by prepending headers

22Bytes20Bytes20Bytes 4Bytes

64 to 1500 Bytes

Page 73: Computer Networks

The Computer Continuum 7-73

Communication Basics of Networks

• Types of connections of computers into networks: Physical versus Wireless connections

– The first type: The Physical Connection. • Physically connect computers together.

– Use of wires or optical cables.– The connections are called network links.

• Three most common physical links:– Twisted pair– Coaxial cable– Fiber-optic cable

Page 74: Computer Networks

The Computer Continuum 7-74

Communication Basics of Networks

• Twisted pair

– Two wires twisted together.• Makes them less susceptible to acting like

an antenna and picking up radio frequency information or appliance noise.

– Telephone company uses twisted-pair copper wires to link telephones.

Page 75: Computer Networks

The Computer Continuum 7-75

Communication Basics of Networks

• Coaxial cable

– Also two wires: • One of the wires is woven of fine strands of

copper forming a tube. • The wire mesh surrounds a solid copper wire

that runs down the center. • Space between has a non-conducting

material.• Makes them more impervious to outside

noise.

Page 76: Computer Networks

The Computer Continuum 7-76

Communication Basics of Networks

• Fiber-optic cable

– Light is electromagnetic.

– Can transmit more information down a single strand.

• It can send a wider set of frequencies.

– Each cable can send several thousand phone conversations or computer communications.

Page 77: Computer Networks

The Computer Continuum 7-77

Communication Basics of Networks

• Second type of connections of computers into networks: Wireless connections– The link is made using electromagnetic energy that

goes through space instead of along wires or cables.– Three types of wireless communications commonly

used in networking:• Infrared• Radio frequency• Microwave

Page 78: Computer Networks

The Computer Continuum 7-78

Communication Basics of Networks

• Infrared

– Commonly used in TV and VCR remote controls.

– Use infrared frequencies of electromagnetic radiation that behave much like visible light.

– Must be in the line of sight.– Often used to connect

keyboards, mice, and printers.

Page 79: Computer Networks

The Computer Continuum 7-79

Communication Basics of Networks

• Radio frequency

– Uses radio frequencies.• Function even though

line of sight is interrupted.

– Not commonly used because of the possible interference from other sources of electromagnetic radiation such as old electric drills and furnace motors.

Page 80: Computer Networks

The Computer Continuum 7-80

Communication Basics of Networks

• Microwave

– Often used to communicate with distant locations.

– Must be line of sight.– Satellite

communications use microwaves.

Page 81: Computer Networks

The Computer Continuum 7-81

Communication Basics of Networks

• Properties of TransmissionFive basic properties of both the physical and wireless links:

1. Type of signal communicated (analog or digital).

2. The speed at which the signal is transmitted (how fast the data travels).

3. The type of data movement allowed on the channel (one-way, two-way taking turns, two-way simultaneously).

4. The method used to transport the data (asynchronous or synchronous transmission).

5. Single channel (baseband) and multichannel (broadband) transmission.

Page 82: Computer Networks

The Computer Continuum 7-82

Communication Basics of Networks

1. Type of signal communicated (analog or digital).– Analog: Those signals that vary with smooth

continuous changes.• A continuously changing signal similar to that

found on the speaker wires of a high-fidelity stereo system.

– Digital: Those signals that vary in steps or jumps from value to value. They are usually in the form of pulses of electrical energy (represent 0s or 1s).

Page 83: Computer Networks

The Computer Continuum 7-83

Communication Basics of Networks

2. The speed at which the signal is transmitted (how fast the data travels).– In digital systems: Speed is measured in...

• Bits per second (bps).– The number of bits (0’s and 1’s) that travel down the

channel per second.

• Baud rate– The number of bits that travel down the channel in a

given interval.– The number is given in signal changes per second, not

necessarily bits per second.

Page 84: Computer Networks

7-84

Communication Basics of Networks

• MODEM - MOdulator DEModulator

– Outgoing: Converts binary data from computer (digital) into telephone compatible signals (analog).

– Incoming: Converts telephone signal (analog) into binary data for the computer (digital).

– Can be an external or internal device (usually a “card”).

Page 85: Computer Networks

The Computer Continuum 7-85

Communication Basics of Networks

• Speed of Signal: Sample bps and baud rate speeds.

300 bps (=300 baud) Painfully slow to the college-level reader1200 bps (=1200 baud) Good reader can keep up2400 bps (=2400 baud) A speed reader would get the general idea9600 bps (=9600 baud) Impossible to read14.4 K bps (not measured in baud) 14,400 bps - 10 to 20 sec. wait for graphics28.8 K bps Minimum desired for WWW

(5 to 10 sec. wait for graphics)56 K bps Efficient speed for WWW.

These speeds are restricted to the maximum speed of the modem at theother end of the connection.

Page 86: Computer Networks

The Computer Continuum 7-86

Software Architectureof Networks

• Types of nodes important to networks.

Hub A device that repeats or broadcasts the network stream of information to individual nodes ( usually personal computers)

Switch A device that receives packets from its input link, and then sorts them and transmits them over the proper link that connects to the node addressed.

Bridge A link between two networks that have identical rules of communication.

GatewayA link between two different networks that have different rules of communication.

Router A node that sends network packets in one of many possible directions to get them to their destination.

Page 87: Computer Networks

87

Channel access on links

• Channel access method allows several terminals connected to the same multi point trans media to transmit over it and to share it capacity

• If no arbitration, several stations/users may transmit at the same time: COLLISIONS!

• How to allocate single shared, broadcast channel among several stations/users.

Page 88: Computer Networks

88

Multiplexing

• Sharing a link/channel among multiple source-destination pairs.

• Example: high-capacity long-distance trunks (fiber, microwave links) carry multiple connections at the same time.

• Channel access scheme is also based on a multiple access protocol and control mechanism…

MU

X

.

..

DE

MU

X ...

Page 89: Computer Networks

89

Multiplexing Techniques

• 3 basic types:– Frequency-Division Multiplexing (FDMA).– Time-Division Multiplexing (TDMA).

– Code Time-Division Multiplexing (CDMA).

Static

Dynamic

Page 90: Computer Networks

90

FDMA

Time

Frequency

1 2 N

•Available bandwidth is divided into frequency bands

•Each station is allocated to send its data

•In this method when any one frequency level is kept idle and another is used frequently leads ti inefficiency

Page 91: Computer Networks

91

FDM

• Simple.

• But:– What if number of users is large?– What if number of users changes over time?– What if traffic is bursty?

Page 92: Computer Networks

92

TDM

Time

Frequency

12

N

•Stations share the bandwidth of the channel in time

•Each station is allocated a time slot during which it can send data

•But…each station needs to know the beginning of its slot and the location of its slot

Page 93: Computer Networks

93

TDM (Cont’d)

• Time divided into time slots.

• One or more slots assigned to a data source.

• But, also inefficient…

1 2 N... 1 2 ... N

frame Time

U1 U2 ... UN

Page 94: Computer Networks

94

Dynamic Multiplexing

• Dynamic allocation.

• In particular, statistical TDM.– Dynamically allocates time slots on

demand.

• Increased channel utilization.

• Examples CDMA,round robin MAC, Scheduled MAC…

Page 95: Computer Networks

Code division multiple access• CDMA differs from FDMA because only one channel

occupies the entire bandwidth of the link• It differs from TDMA because all stations can send

data at the same time without timesharing• CDMA simply means communication with different

codes• It is based on coding theory, each station is

assigned a code, which is a sequence of numbers called chips and chips will be added with original data and it can be transmitted thro’ same medium.

Page 96: Computer Networks

96

Multiple Access Protocols

• Centralized approaches:– Controller grants access to medium.– Simple, greater control: priorities, QoS.– But, single point of failure and performance

bottleneck.

• Decentralized schemes:– All stations collectively run MAC to decide when to

transmit.

Page 97: Computer Networks

97

Round-Robin MAC

• Each station is allowed to transmit; station may decline or transmit (bounded by some maximum transmit time).

• Centralized (e.g., polling) or distributed (e.g., token ring) control of who is next to transmit.

• Efficient when many stations have data to transmit over extended period (stream).

Page 98: Computer Networks

98

Scheduled-Access MAC

• Time divided into slots.• Station reserves slots in the future.• Multiple slots for extended transmissions.• Suited to stream traffic.

Page 99: Computer Networks

Lecture 4: 9-6-01 99

Framing

• Techniques

1. Bye oriented protocols (BISYNC,PPP,DDCMP)

2. Bit oriented protocols(HDLC)

3. Clock based Framing(SoNET)

Page 100: Computer Networks

Byte oriented protocols• Collection of bytes rather than collection of bits• Sentinel approach• Beginning of a frame is denoted by sending a SYN

character• Data portion contained between STX and ETX

• CRC is used to detect transmission error.

SYN SYN SOH HEADER STX BODY ETX CRC

Page 101: Computer Networks

Lecture 4: 9-6-01 101

BISYNC Framing

• Escaping the ETX character by preceding it with a DLE character whenever it appears in the body

• Byte stuffing– Special start of frame byte (e.g. 0xFF)– Special escape byte value (e.g. 0xFE)– Values actually in text are replaced (e.g. 0xFF by

0xFEFF and 0xFE by 0xFEFE)– Worst case – can double the size of frame

Page 102: Computer Networks

PPP

Flag Address Control Protocol Payload Checksum flag

•Flag Field has 01111110 as starting sequence•Address and control fields usually contain default values•Protocol filed is used for demultiplexing•Payload size can be negotiated…•Negotiation conducted by a protocol –LCP(Link control protocol)•LCP sends control messages encapsulated in PPP frames

Page 103: Computer Networks

DDCMP

Syn Syn Class Count Header Body Crc

•No of bytes contained in a frame can be included as a field in header

•Count field specifies how many bytes are contained in the frame body

•Sometimes count field will be corrupted during transmission, receiver accumulate many bytes as count filed indicates---- framing error

•Receiver then wait until it sees the next SYN character

Page 104: Computer Networks

Bit oriented protocols(HDLC)

Beginning sequences

Header Body CRC Ending sequences

•HDLC has both beginning and end of a frame with bit sequence 01111110

•Sequence may be appear anywhere in the body of the frame, it can be avoided by bit stuffing

•On the sending side, Five consecutive 1’s have been transmitted from the body of the message, the sender inserts a 0 before transmitting next bit

•On the receiving side, five consecutive 1’s arrived, so receiver makes its decision based on the next bit it sees…

Page 105: Computer Networks

HDLC…

• If next bit is 0, it must have been stuffed . So receiver removes it

• Suppose next bit is 1 then• either end of frame marker or error• If it is 0 (i.e last eight bits it has looked at are

01111110) then it end of frame marker• If it is 1 (i.e the last eight bits it has looked at

are 01111111) then there must have been an error so whole frame may be discarded..

Page 106: Computer Networks

Clock based framing (SONET)

•Synchronous optical network is used for long distance transmission of data over optical network

•Supports multiplexing of several low speed links into one high speed links

Page 107: Computer Networks

SONET…

• It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead, with the rest being available for data.

• The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable the receiver to determine where the frame starts.

• The receiver looks for the special bit pattern consistently, once in every 810 bytes, since each frame is 9 x 90 = 810 bytes long.

Page 108: Computer Networks

Error detection and Correction

• Types of errors

1. single bit error: only one bit of data unit

changing from 0 to 1 and vice versa

.

Page 109: Computer Networks

Error detection and correction…

• Burst Error• The term Burst Error means that two or more

bits in the data unit have changed from 1 to 0 or from 0 to 1

Page 110: Computer Networks

Error detection and correction…

Redundancy One method is to send every data twice, so that receiver checks every bit

of two copies and detect error.

Drawbacks• Sends n-redundant bits for n-bit message.• Many errors are undetected if both the copies are corrupted.• Instead of adding entire data, some bits are appended to each unit..

These bits are called error detecting codes.

Three error detecting techniques are:• Parity check

• Check sum algorithm

• Cyclic Redundancy Check

Page 111: Computer Networks

Error detection and correction…

• Parity Check

simplest form of error detection is to append a single bit ….

• Simple parity check Only one redundant bit, called parity bit is added to every data

unit so that the total number of 1’s in unit become even (or odd)

Drawbacks:• Receiver can detect an error but it can not specify which bit is

error• Detect only single bit error

Page 112: Computer Networks

Error detection and correction…

Two Dimensional Parity• It is based on simple parity

• Two dimensional parity check and block is organized in rows and columns…then parity of each data unit is calculated

• Then calculate parity bit of each column, write column parity also

• Then attach 8 parity bit original data and send to receiver

Drawback if two bits in one data unit are changed and two bits in exactly at same

position in another data unit is changed, so checker can’t detect an error

Page 113: Computer Networks

Error detection and correction…

Check sum algorithm• All the words are added and then transmit the result of sum

called checksum with the data• Receiver performs the same calculation on the received data and

compares the result with the received checksum• If any corruption in transmitted data, then results will not match.

so error occurred at receiver…• Instead of sending the checksum as such, one’s complement of

that sum will be send to receiver. If it as zero ,it will be correct one

• If number has more than n bits, then extra leftmost bits need to be added to the n rightmost bits

• Data can be divided into 16 bit word and checksum is initialized to zero

Page 114: Computer Networks

Lecture 4: 9-6-01 114

Internet Checksum

Sender• Treat segment contents

as sequence of 16-bit integers

• Checksum: addition (1’s complement sum) of segment contents

• Sender puts checksum value into checksum field in header

Receiver• Compute checksum of

received segment• Check if computed

checksum equals checksum field value:– NO - error detected– YES - no error detected.

But maybe errors nonethless?

• Goal: detect “errors” (e.g., flipped bits) in transmitted segment

Page 115: Computer Networks

Lecture 4: 9-6-01 115

Error Detection – Cyclic Redundancy Check (CRC)

• A very popular error detecting code implemented in many data transmission schemes is the cyclic redundancy check (CRC) code.

• CRC is an international standard approach to error detection. It protects the data with a checksum or cyclic redundancy check

• CRC was first developed by the CCITT (Committee Consultative International Telegraphic Telephonic) now called ITU – T (International Telecommunications Union)

• CRC is based on binary division. In CRC a sequence of redundant bits, called the CRC or the CRC remainder is appended to the end of a data stream. The resulting data

becomes exactly divisible by a second, predetermined binary number.

• At its destination, the incoming data is divided by the same number

Page 116: Computer Networks

Error Detection – Cyclic Redundancy Check (CRC)…

• Polynomial Generator is used to calculate a binary equivalent. – Present powers are identified as 1 and a absent powers as 0.

• CRC generator (divisor) is usually represented not as a string of 1s and 0s but as an algebraic polynomial

• CRC Generator uses modulo-2 division

Page 117: Computer Networks

Lecture 4: 9-6-01 117

CRC Example

Page 118: Computer Networks

ERROR CORRECTION • Handled in two ways

1.First one, when an error is discovered, the receiver can have the sender retransmit the entire data unit.

2.In the other, a receiver can use an error correcting code, which automatically corrects certain errors.

Types of error correction:

1. Single bit error correction

2. Burst bit error correction

Page 119: Computer Networks

Single Bit Error Correction

• To correct a single bit error in an ASCII character, the error correction code must determine which of the seven bits has changed.

• Determine eight different states: no error, error in position 1, error in position 2, …..error in position 7.

• Looks like a three bit redundancy code…. because three bits can show eight different states.

• But what if an error occurs in the redundancy bits?

Seven bits of data and three bits of redundancy bits equal 10 bits. So three bits are not adequate…..

Page 120: Computer Networks

• To calculate the number of redundancy bits (r) required to correct a given number of data bits (m) … find a relationship between m and r.

• If the total number of bits in a transmittable unit is m+r then r must be able to indicate at least m+r+1 different state. Of these, one state means no error and m+r states indicate the location of an error in each of the m+r positions.

• So m+r+1 state must be discoverable by r bits. And r bits can indicate 2r different states. Therefore, 2r must be equal to or greater than m+r+1;

2r >=m+r+1

Page 121: Computer Networks

NUMBER OF DATA BITS (M) NUMBER OF REDUNDANCY BITS (R)

TOTAL BITS (M+R)

1 2 3

2 3 5

3 3 6

4 3 7

5 4 9

6 4 10

7 4 11

Page 122: Computer Networks

Hamming code

• The hamming code can be applied to data units of any length and uses the relationship between data and redundancy bits …

• R.W hamming provides a practical solution for error correction..

• It is extension of simple method that can be used to detect and correct the larger set of errors..

Page 123: Computer Networks

Hamming code…

• Seven bit ASCII code requires four redundancy bits that can be added to the end of the data…

• These redundancy bits are placed in positions 1, 2,4,and 8, so this bits as r1,r2,r3 and r4..

• Combination used to calculate each of the four r values for seven bit data sequence..

D D D R D D D R D R R

11 10 9 8 7 6 5 4 3 2 1

Page 124: Computer Networks

Hamming code…

• r1 bit is calculated using all bits positions whose binary value include a 1 in the rightmost position….

• r2 is calculated using all bit position with a 1 in the second position and so on….

r1: bits 1,3,5,7,9,11

r2: bits 2,3,6,7,10,11

r3: bits 4,5,6,7

r4: bits 8,9,10,11

Page 125: Computer Networks

Hamming code…

Calculating r values..Place each bit of the original character in its

appropriate position in the 11 bit unitCalculate the even parties for the various bit

combinationParity value for each combination is the

value of the corresponding r bit

Page 126: Computer Networks

Hamming code…

1 0 0 1 1 0 1 0 1

1 0 0 1 1 0 1 1

1 0 0 1 1 0 1

1 0 0 1 1 0 0 1 0 1

1 0 0 1 1 1 0 0 1 0 1

Page 127: Computer Networks

Hamming code…At the receiver side • Receiver takes the transmission and recalculates four

new r values using the same set of bits used by the sender plus the relevant parity (r) bit for each set. Then it assembles the new parity values into a binary number in order of r position (r8, r4, r2, r1).

• This step gives us the binary number which is the precise location of the bit in error

• Once the bit is identified, the receiver can reverse its value and correct the error

Page 128: Computer Networks

Hamming code…

1 0 0 1 0 1 0 0 1 0 1

1 0 0 1 0 1 0 0 1 0 1

1 0 0 1 0 1 0 0 1 0 1

1 0 0 1 0 1 0 0 1 0 1

Page 129: Computer Networks

Burst Bit Error Correction• Hamming code can be designed to correct

burst errors of certain length…• Number of redundancy bits required to make

these corrections..• To correct double bit errors, the two bits can

be a combination of any two bits in the entire sequence.

• Three bit correction means any three bits in the entire sequence and so on…

Page 130: Computer Networks

FUNCTIONS OF DATA LINK LAYER

Data link layer Functions

1.Line discipline

2. Flow control

3. Error control

4. Framing

Page 131: Computer Networks

LINE DISCIPLINE

• Line discipline coordinates the link system.

• Line discipline can serve in two ways

1. Enquiry / acknowledgement (ENQ / ACK)

2. Poll / select (POLL / SELECT)

Page 132: Computer Networks

ENQ / ACK

Page 133: Computer Networks

Poll

• Work with topologies where one device is designated as primary and the other devices are secondary

• Primary device controls the link…Secondary devices follow its instructions..

• Primary asks the secondary if they have anything to send- Polling

• Primary tells the target secondary to get ready to receive - Selecting.

Page 134: Computer Networks

POLL

• Used by the primary device to solicit transmission from the secondary devices.

• Secondary are not allowed to transmit data unless asked by the primary device.

• When the primary ready to receive data, it must ask (poll) each device in turn if it has anything to send.

• If the secondary have data to transmit it sends the data frame otherwise sends a negative acknowledgment (NAK).

Page 135: Computer Networks

Poll…

• Primary then polls the next secondary……. When the response is positive (a data frame), the primary reads the frame and returns an acknowledgment (ACK).

• Terminate the transmission: either the secondary sends all data, finishing with an EOT frame, or the primary says “timer‟s up”. Then the primary cal polls the remaining devices.

Page 136: Computer Networks

Poll…

Page 137: Computer Networks

SELECT

Page 138: Computer Networks

FLOW CONTROL • Set of procedures used to restrict the amount of data flow

between sending and receiving stations. • Most common retransmission technique: ARQ• ARQ has three cases

Demaged frames

Lost frames

Lost acknowledgement

Function:• Transmission of frames• Error checking at receiver • Acknowledgement

1. Negative if error detected(NAK)

2. Positive if No error detected(ACK)

Page 139: Computer Networks

Automatic Repeat Request

ARQ categorized in two types

• ARQ- Stop and wait ARQ and Sliding window ARQ

• Further Sliding window ARQ divided into two types

1. Go-Back-N

2. Selective repeat

Page 140: Computer Networks

STOP AND WAIT

sender waits for acknowledgment after every frame it sends. Only after an acknowledgment has been received, then the sender sends the next frame.

Page 141: Computer Networks

Sliding Window•Sender can transmit several frames before needing an acknowledgment. •Receiver acknowledges only some of the frames, using a single ACK to confirm the receipt of multiple data frames

Page 142: Computer Networks

SENDER WINDOW

Page 143: Computer Networks

Example: Sliding Windows

Page 144: Computer Networks

ERROR CONTROL

• Error control is implemented with the flow control mechanism.

Page 145: Computer Networks

STOP AND WAIT ARQ

• It is a form of stop and wait flow control, extended to include retransmission of data in case of lost or damaged frames

• DAMAGED FRAME• LOST DATA FRAME• LOST ACKNOWLEDGEMENT

Page 146: Computer Networks

STOP AND WAIT ARQDamaged Frame

Page 147: Computer Networks

STOP AND WAIT ARQ

Lost Data Frame

Page 148: Computer Networks

STOP AND WAIT ARQ

LOST ACKNOWLEDGEMENT

Page 149: Computer Networks

SLIDING WINDOW ARQ

• Used to send multiple frames per time. • Number of frame is according to the window

size. • Sliding window is an imaginary box which is

reside on both sender and receiver side. • Types

1. go-back-n ARQ

2. selective reject ARQ

Page 150: Computer Networks

GO-BACK-N ARQ

• if one frame is lost or damaged, all frames sent since the last frame acknowledged or retransmitted.

Page 151: Computer Networks

Demaged Frame

Page 152: Computer Networks

LOST FRAME:

Page 153: Computer Networks

LOST ACK

Page 154: Computer Networks

SELECTIVE REPEAT ARQ

• Selective repeat ARQ retransmits only the damaged or lost frames instead of sending multiple frames.

• Selective transmission increases the efficiency of transmission and is more suitable for noisy link.

• Receiver should have sorting mechanism.

Page 155: Computer Networks

Damaged Frame

Page 156: Computer Networks

Lost Frame

Page 157: Computer Networks

Lost ACK

Page 158: Computer Networks

The Computer Continuum 7-158

Communication Basics of Networks

4.The method used to transport the data.– Two types of data transmission, each requiring a different

modem.– Asynchronous transmission -

• Information is sent byte by byte.• Cheaper and more commonly used.

– Synchronous transmission - • Data is sent in large blocks rather than in small pieces.• Preceded by special information, concerning error

detection and block size.• These modems are expensive but very fast.

Page 159: Computer Networks

The Computer Continuum 7-159

Communication Basics of Networks

5. Single channel versus multichannel transmission– Channel - A path of a signal.– Single channel - Capable of only sending/receiving

one signal at a time.• Phone line: Single line = single phone call at a

time.– Multichannel - Capable of more than one channel at

a time.• Fiber-optic cable, microwaves, Satellite

transmissions.

Page 160: Computer Networks

The Computer Continuum 7-160

Communication Basics of Networks

• How is it possible to measure the capacity of communications links? – Bandwidth: Digital

• Number of bits per second (bps) that can be sent over a link.

• The wider the bandwidth, the more diverse kinds of information can be sent.

• Simplest is voice, most sophisticated is moving videos.

– Bandwidth: Analog

• The difference between the highest and lowest frequencies that can be sent over an analog link (like phone lines).

• Measurement is given in hertz (Hz).

– For both: The wider the bandwidth, the more information can flow over the channel.

Page 161: Computer Networks

The Computer Continuum 7-161

Communication Basics of Networks

Mbps = megabytes per sec. (millions) Gbps=Gigabytes per sec. (billions)

Typical cable bandwidths used in local area networks.Cable: Typical Bandwidth:Twisted Pair 10 to 100 MbpsCoaxial Cable 10 to 100 MbpsFiber-optic cable 100 to 200 Mbps

The bandwidths of different services offered by a telephone company:Service: BandwidthISDN 64 Kbps/channelT1 1.544 MbpsT3 44.736 MbpsSTS-1 51.840 MbpsSTS-3 155.250 MbpsSTS-12 622.080 MbpsSTS-24 1.244160 GbpsSTS-48 2.488320 Gbps

Page 162: Computer Networks

The Computer Continuum 7-162

The Physical Organization of Networks

• Two parts to connect computers to networks– The hardware needed to connect the computer to the

network.– The software needed to control the hardware.

• (Software standards will be discussed in the next section.)

Page 163: Computer Networks

The Computer Continuum 7-163

The Physical Organization of Networks

• Node: The generic name given to all devices hooked up to a network.– Each node must have a unique address assigned to

them by the network.– Networks are either direct-connected or those that are

not directly linked.• Direct-connected network: Those whose nodes

have direct connections through either physical or wireless links.

– Point-to-point: Simplest version of direct-connected network. Connecting two computing systems.

» Example of point to point: Home to ISP.• Example of a network that is not directly linked:

Internet.

Page 164: Computer Networks

The Computer Continuum 7-164

The Physical Organization of Networks

• The bus network - – A continuous coaxial

cable to which all the devices are attached.

– All nodes can detect all messages sent along the bus.

• The ring network -– Nodes linked together to

form a circle.– A message sent out from

one node is passed along to each node in between until the target node receives the message.

Linking nodes:

Page 165: Computer Networks

The Computer Continuum 7-165

The Physical Organization of Networks

• The star network - – Each node is linked to a

central node.– All messages are routed

through the central node, who delivers it to the proper node.

• The tree network - (hierarchical network)– Looks like an upside-down

tree where end nodes are linked to interior nodes that allow linking through to another end node.

Linking nodes:

Page 166: Computer Networks

The Computer Continuum 7-166

The Physical Organization of Networks

• The fully connected network - – All nodes are connected

to all other nodes.

• Internetworking -– Connecting together any

number of direct-connected networks.

– The largest: Internet.

Linking nodes:

Page 167: Computer Networks

MAUs in a Token Ring network

Page 168: Computer Networks
Page 169: Computer Networks

Networking Protocols

TCP/IP

IPX/SPX

NetBEUI

AppleTalk

Page 170: Computer Networks

Applying the OSI Model

Table 2-1: Functions of the OSI layers

Page 171: Computer Networks

Communication Between Two Systems

Figure 2-7: Data transformation through the OSI Model

Page 172: Computer Networks

Frame Specifications

• The two major categories of frame types:– Ethernet

• Four types of Ethernet frames• Most popular form characterized by unique way in

which devices share a common transmission channel (described in IEEE 802.3 standard)

– Token Ring: relies on direct links between nodes and a ring topology

• Nodes pass around tokens (control frames that indicate to network when a node is about to transmit data)

Page 173: Computer Networks

IEEE Networking Specifications

• Apply to connectivity, networking media, error checking algorithms, encryption, emerging technologies, and more

• Specifications fall under IEEE’s “Project 802”– Effort to standardize physical and logical elements of

a network

Page 174: Computer Networks

Summary

• Standards are documented agreements containing precise criteria that are used as guidelines to ensure that materials, products, processes, and services suit their purpose

• ISO’s OSI Model divides networking architecture into seven layers

• Each OSI layer has its own set of functions and interacts with the layers directly above and below it

• Application layer protocols enable software to negotiate their formatting, procedural, security, and synchronization with the network

Page 175: Computer Networks

Summary (continued)

• Presentation layer protocols serve as translators between the application and the network

• Session layer protocols coordinate and maintain links between two devices for the duration of their communication

• Transport layer protocols oversee end-to-end data delivery

• Network layer protocols manage logical addressing and determine routes based on addressing, patterns of usage, and availability

Page 176: Computer Networks

Summary (continued)

• Data Link layer protocols organize data they receive from the Network layer into frames that contain error checking routines and can then be transmitted by the Physical layer

• Physical layer protocols generate and detect voltage to transmit and receive signals carrying data over a network medium

• Data frames are small blocks of data with control, addressing, and handling information attached to them

Page 177: Computer Networks

References

• http://vi.wikipedia.org/wiki/Mô_hình_OSI