Anda di halaman 1dari 93

CS6551 - COMPUTER

NETWORKS
COMPUTER NETWORKS

A computer network is a set of computers connected


together for the purpose of sharing resources.

The most common resource shared today is connection


to the Internet.

Other shared resources can include a printer or a file


server.
DATA COMMUNICATION

• Data communication is the exchange of data


(in the form of 1s and 0s) between two
devices via some form of transmission
medium (such as a wire cable).
OSI Architecture

The OSI 7-layer Model


OSI – Open Systems Interconnection
ISO (International standard organization)
Chapter 1
Features provided by layering
• It decomposes the problem of building a
network into more manageable components.

• It provides a more modular design

• Example: ‘modular furniture’,


which means furniture made with standard
units and parts.

5
Chapter 1
Need for protocol
• In networks, communication occurs
between the entities in different systems.
• Two entities cannot just send bit streams
to each other and expect to be understood.
• For communication, the entities must
agree on a protocol.
• A protocol is a set of rules and regulations
that govern data communication.

6
Chapter 1
Group of OSI layer by function
• The seven layers of the OSI model belonging to three
subgroups.
• Physical, data link and network layers are the network
support layers; they deal with the physical aspects of
moving data from one device to another.
• Session, presentation and application layers are the user
support layers; they allow interoperability among unrelated
software systems. (Interoperable: when two or more
protocols that implement the specification accurately)
• The transport layer ensures end-to-end reliable data
transmission.

7
Chapter 1
Description of Layers
• Physical layer - Encoding, Data rate, Physical
topology (ring, star, bus), Transmission mode.
• Data link layer - Framing, Physical addressing, Error
control, Flow control, Access control
• Network layer – Source to destination delivery of
packets, Logical addressing, routing
• Transport layer – End to end delivery of entire
message- Service-point addressing, Segmentation
and reassembly, Connection control.
• Session layer – It establishes and maintains and
synchronizes interaction among communication
systems. Dialog control, synchronization, binding
8
Chapter 1
Contd.
• Presentation layer: Translation,
Encryption, Compression
• Application layer: The application layer
enables the user, whether human or
software, to access the network. It
provides user interface and support for
services such as electronic mail, remote
file access, shared database management
and several types of distributed services.

9
Chapter 1
Syllabus
• UNIT I FUNDAMENTALS & LINK LAYER - Building a
network – Requirements - Layering and protocols -
Internet Architecture – Network software –
Performance ; Link layer Services - Framing - Error
Detection - Flow control
• UNIT II MEDIA ACCESS & INTERNETWORKING -
Media access control - Ethernet (802.3) - Wireless
LANs- 802.11 – Bluetooth - Switching and bridging –
Basic Internetworking (IP, CIDR, ARP, DHCP,ICMP )
• UNIT III ROUTING - Routing (RIP, OSPF, metrics) –
Switch basics – Global Internet (Areas, BGP, IPv6),
Multi cast addresses – multicast routing (DVMRP,
PIM)

10
Chapter 1
Contd.
• UNIT IV TRANSPORT LAYER - Overview of
Transport layer - UDP - Reliable byte stream (TCP)
- Connection management – Flow control -
Retransmission – TCP Congestion control -
Congestion avoidance (DECbit, RED) – QoS –
Application requirements

• UNIT V APPLICATION LAYER - Traditional


applications -Electronic Mail (SMTP, POP3, IMAP,
MIME) – HTTP – Web Services – DNS- SNMP

11
Chapter 1
Requirements for Building a
network
Perspectives

• An application programmer list the services based on


application needs. For example, a guarantee that each
message will be delivered without error or within a
certain time.
• A network operator lists the characteristics of a
system that is easy to administer(maintain) and
manage. For example, fault isolation, adding new
devices, easy to account for usage, etc.
• A network designer lists the properties of a cost-
effective design. For example, efficient utilization of
network resources, fair allocation to users, etc.
12
Connectivity
• Need to understand the
following terminologies
– Scalable - support growth
to large size
– Link – Physical medium
– Nodes – Devices
connected to link
– Point-to-point
– Multiple access
– Switched Network-end
nodes are connected
through a set of forwarding
nodes –switch

• Circuit Switched –
dedicated
link
• Packet Switched – store
(a) Point-to-point and forward

(b) Multiple access


Connectivity
• Terminologies (contd.)
– Cloud – set of independent
networks
(a)
– Internetwork-Independent
networks are connected to
form internetwork or
internet
– Internet-name for a specific
world wide network
– Switch-connecting two or
more nodes in the same
network or different
network
– Router/gateway-node that
connects two or more networks
(b)
– Host-to-host connectivity
– Address
– Routing
(a) A switched network – Unicast/broadcast/multicast
(b) Interconnection of networks
Cost-Effective Resource Sharing
• Resource: Physical link
• To share a link
– Multiplexing
– De-multiplexing
– Synchronous Time-division
Multiplexing
• Time slots/data
transmitted in
predetermined slots
• Statistical multiplexing
Multiplexing multiple logical flows
over a single physical link
-Packets are transmitted from
each flow on demand, rather
than on predetermined slot.
• Frequency division multiplexing
(FDM)
Cost-Effective Resource Sharing
A switch multiplex packets from
multiple sources onto one shared
link

Switch decides which packet is to be


transmitted from the packets queued up,
according to queuing discipline such as
FIFO.
Support for Common Services
• Since applications have common services in, it is apt
for the network designer to identify and implement a
common set of services for the application designer
to build upon.
• Network provide logical channels and set of services
required for process-to-process communication.

Process communicating over an


abstract(hide) channel
Reliability

• Reliability is an important characteristic to be


provided by the network, i.e., it should be
possible for the network to recover from errors.
• Single bit/ burst errors may occur during data
transmission due to interference. Such errors
can be detected and retransmission sought for.
• Packets can be dropped due to congestion or
wrongly routed.
• Links can fail or node can crash. In case of
failed link, it should be possible to route the
packet along alternate path.
Network Architecture

Example of a layered network system


Network Architecture

Layered system with alternative abstractions available at a given layer

⮚Request/reply channel guarantees delivery of message and ensures privacy


and integrity of data required in case of FTP or digital library.

⮚Message stream channel does not guarantee delivery of all data but assures
in-order delivery, required in applications like video conferencing.
Protocols
• Protocol defines the interfaces between the
layers in the same system and with the layers
of peer system.
• Building blocks of a network architecture
• Each protocol object has two different
interfaces
– service interface: operations on this protocol is in
same host
– peer-to-peer interface: messages exchanged with
peer
• Protocol Specification: prose, pseudo-code, state
transition diagram.
Interfaces

Service and Peer Interfaces


Protocol Graph

Example of a protocol graph


nodes are the protocols and links the “depends-on” relation
⮚The suite of protocols that make up a network system is represented as a
protocol graph.
⮚The nodes correspond to protocols and edges represent a depends-on
relation.
⮚RRP-request/reply protocol ,MSP – Media streaming protocol
Encapsulation

High-level messages are encapsulated inside of low-level messages


OSI Architecture

The OSI 7-layer Model


OSI – Open Systems Interconnection
Internet Architecture(TCP/IP model)
internetworking - connecting networks together to
make an internetwork or an internet.

Alternative view of the Internet


architecture. The “Network”
Internet Protocol Graph layer shown here is sometimes
referred to as the “sub-
network” or “link” layer.
Chapter 1
Switching at the network layer in
the Internet uses the datagram
approach to packet switching.
Communication at the network
layer in the Internet is
connectionless.

The Internet Protocol version 4 (IPv4) is the


delivery mechanism used by the TCP/IP
protocols.

27
Chapter 1
Position of IPv4 in TCP/IP protocol suite

28
Application Programming Interface

• Interface exported by the network


• Most network protocols are implemented (those in
the high protocol stack) in software.
• All computer systems implement their network
protocols as part of the operating system, when we
refer to the interface “exported by the network”,
which are generally referring to the interface that
the OS provides to its networking subsystem
• The interface is called the network Application
Programming Interface (API)
Application Programming Interface (Sockets)

• Socket Interface was originally provided by the


Berkeley distribution of Unix
- Now supported in virtually all operating systems

• Each protocol provides a certain set of services, and


the API provides a syntax by which those services
can be invoked in this particular OS
Socket

• Socket
– The point where a local application process
attaches to the network
– An interface between an application and the
network
– An application creates the socket
• The interface defines operations for
– Creating a socket
– Attaching a socket to the network
– Sending and receiving messages through the
socket
– Closing the socket
Socket
• Socket Family
– PF_INET denotes the Internet family
– PF_UNIX denotes the Unix pipe facility
– PF_PACKET denotes direct access to the network
interface (i.e., it bypasses the TCP/IP protocol
stack)

• Socket Type
– SOCK_STREAM is used to denote a byte stream
– SOCK_DGRAM is an alternative that denotes a
message oriented service, such as that provided by
UDP
Client-Serve Model with TCP

Bind
– Binds the newly created socket to the specified
address i.e. the network address of the local
participant (the server)
– Address is a data structure which combines IP
and port
Listen
– Defines how many connections can be pending
on the specified socket
Performance
Bandwidth,Latency(delay)

⚫Range of frequency occupied by a signal or width of the


frequency band
⚫Number of bits per second that can be transmitted over a
communication link
⚫1 Mbps: 1 x 106 bits/second = 1x220 bits/sec
⚫1 x 10-6 seconds to transmit each bit or imagine that a timeline,
now each bit occupies 1 micro second space.
⚫On a 2 Mbps link the width is 0.5 micro second.
⚫Smaller the width of the signal more will be transmission per
unit time.
⚫Throughput – Measured performance, Bandwidth - actual
Bandwidth

Bits transmitted at a particular bandwidth can be


regarded as having some width:
(a) bits transmitted at 1Mbps (each bit 1 μs wide)
(b) bits transmitted at 2Mbps (each bit 0.5 μs wide).
Performance

• Latency(delay) = Propagation delay + transmit delay+


queuing delay
• Propagation delay = distance(length of wire)/speed of
light
• Transmit = size(size of the packet)/bandwidth
• For message with only one bit, latency D = Propagation
delay.
• One bit transmission => Propagation is important
• Large bytes transmission => Bandwidth is important
Delay X Bandwidth
• Volume = Delay X Bandwidth --- gives how many bits the
sender can transmit before the first bit arrives at the RX.
• Imagine the channel between a pair of processes as a hollow
pipe
• Latency (delay) is the length of the pipe and bandwidth is the
width of the pipe
• Delay of 50 ms and bandwidth of 45 Mbps
⇒ 50 x 10-3 seconds x 45 x 106 bits/second
⇒ 2.25 x 106 bits = 280 KB data.

Network as a pipe
Delay X Bandwidth

• Relative importance of bandwidth and latency


depends on application.
• For large file transfer, bandwidth is critical
• For small messages (HTTP, NFS, etc.), latency is
critical
• Variance in latency (jitter) can also affect some
applications (e.g., audio/video conferencing)
Delay X Bandwidth
• Infinite bandwidth(achieved by high speed networks)
– RTT(Round trip time) dominates
– Throughput = TransferSize / TransferTime
– TransferTime = RTT + 1/Bandwidth x TransferSize

• Its all relative


– 1-MB file to 1-Gbps link looks like a 1-KB packet to
1-Mbps link
Relationship between bandwidth and latency

A 1-MB file would fill the 1-Mbps link 80 times,


but only fill the 1-Gbps link 1/12 of one time
Chapter 1
Link Capacity and Shannon-Hartley Theorem
• upper bound to the capacity of a link in terms
of bits per second (bps) as a function of signal-
to-noise ratio of the link measured in decibels
(dB). C = Blog2(1+S/N)
• One way to characterize links is by the medium they
use
– Typically copper wire in some form (as in Digital
Subscriber Line (DSL) and coaxial cable),
– Optical fiber (as in both commercial fiber-to-the
home services and many long-distance links in the
Internet’s backbone), or
– Air/free space (for wireless links)
41
Chapter 1
Links
• Another important link characteristic is the
frequency
• Distance between the adjacent pair of maxima or
minima of a wave measured in meters is called
wavelength
– Speed of light divided by frequency gives the
wavelength.
– Frequency on a copper cable range from 300Hz to
3300Hz; Wavelength for 300Hz wave through
copper is speed of light on a copper / frequency
– 2/3 x 3 x 108 /300 = 667 x 103 meters.
• Placing binary data on a signal is called encoding.
• Modulation involves modifying the signals in terms
of their frequency, amplitude, and phase.
42
Links

Electromagnetic spectrum
Links

Common services available to connect your home


Encoding

Signals travel between signaling components;


bits flow between adaptors

NRZ encoding of a bit stream


Encoding

Different encoding strategies


In Manchester encoding 0: low🡪 high
transition
1: high🡪 low
transition
Chapter 1
Framing
• It is the process in which the data link layer receive
the packets from the network layer and converts
them into smaller frames for transmission.
• Then it adds header and trailer with that.
• Packets – Frames –Fixed size, Variable size

Bits flow between adaptors, frames between hosts

47
Chapter 1
A frame in a character-oriented protocol

Variable size – Character oriented (or)byte oriented


approach, Bit oriented approach

11.48
48
Chapter 1
Byte stuffing and unstuffing
Byte stuffing is the process of adding 1 extra byte
whenever there is a flag or escape character in the text.

49
Chapter 1
PPP frame format

PPP(point to point) is a byte-


oriented protocol using byte
stuffing with the escape byte
01111101.

11.50
50
Chapter 1
A frame in a bit-oriented protocol
High-level Data Link Control (HDLC) is a bit-oriented protocol
for communication over point-to-point and multipoint links.
❖Configurations and Transfer Modes
Frames
Control Field

Bit stuffing is the process of adding one extra 0


whenever five consecutive 1s follow a 0 in the
data, so that the receiver does not mistake
the pattern 0111110 for a flag.

11.51
51
Chapter 1
Bit stuffing and unstuffing

11.52
52
Chapter 1
53
Chapter 1
Normal response mode

11.54
54
Chapter 1
Asynchronous response mode

HDLC communication mode involving one pr imary station and


at least one secondary station, where either the primary or one
of the secondary stations can initiate transmissions. (Rarely
used)

55
Chapter 1
Asynchronous balanced mode

11.56
56
Chapter 1
HDLC(High level data link control) frames

11.57
57
Chapter 1
Control field format for the different frame types
N(s) – sequence no. of the frame sent N(R) – sequence no. of the frame expected

Poll/Final bit

11.58
58
Chapter 1
U-frame control command and response

11.59
59
Chapter 1
Error Detection
• Common technique for detecting transmission error
– CRC (Cyclic Redundancy Check)
• Used in HDLC, DDCMP (Digital Data Communication
Protocol), CSMA/CD, Token Ring
– Other approaches
• Two Dimensional Parity (BISYNC- Binary Synchronous
Communication)
• Checksum (IP)

60
Chapter 1
Error Detection
• Extra bits are redundant
– They add no new information to the message
– Derived from the original message using some
algorithm
– Both the sender and receiver know the algorithm

Sender Receiver
m r m r

Receiver computes r using m


If they match, no error

61
Chapter 1
Types of Errors
• Single-bit errors

• Burst errors

62
62
Chapter 1
Common Error Detection Methods
• Vertical Redundancy Check

• Longitudinal Redundancy Check

• Cyclic Redundancy Check

• Checksum

63
63
Chapter 1
Vertical redundancy Check

Suppose the sender wants to send the word world. In ASCII


the five characters are coded (with even parity) as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
W o r l d

64
64
Chapter 1
Longitudinal redundancy Check
Block of bits divided in to rows
32bits = 4 rows X 8bits

1100111 1011101 0111001 0101001 0101010LRC


65
65
Chapter 1
Cyclic Redundancy Check (CRC)

• Reduce the number of extra bits and maximize


protection

• Given a bit string 110001 we can associate a


polynomial on a single variable x for it.
1.x5+1.x4+0.x3+0.x2+0.x1+1.x0 = x5+x4+1 and the
degree is 5.

• Let M(x) be a message polynomial and C(x) be a


generator polynomial.
66
Chapter 1
Standard Polynomials

67
67
Chapter 1
Cyclic Redundancy Check
• In a cyclic code, rotating a codeword always results
in another codeword. Cyclically left shift(rotated)
• Example:

68
68
Chapter 1
CRC Encoder/Decoder

69
69
Chapter 1
CRC Generator

70
70
Chapter 1
Checking CRC

71
71
Chapter 1
Number of Redundant Bits
Number of Number of Total
data bits redundancy bits bits
k r k+r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11
72
72
Example

Let us trace the path of three datawords from the sender to the
destination:

1.The dataword 0100 becomes the codeword 0100011.


The codeword 0100011 is received. The syndrome is
000, the final dataword is 0100.

2. The dataword 0111 becomes the codeword 0111001.


The received codeword is: 0011001. The syndrome is 011. After
flipping b2 (changing the 1 to 0), the final dataword is 0111.

3. The dataword 1101 becomes the codeword 1101000.


The syndrome is 101. After flipping b0, we get 0000,
the wrong dataword. This shows that our code cannot
correct two errors.
Chapter 1
Hamming code

74
Chapter 1
Hamming Code
• Simple, powerful FEC
• Widely used in computer memory

error-correcting
bits

75
75
Chapter 1
Redundant Bit Calculation

76
76
Chapter 1
Example: Hamming Code

77
77
Chapter 1
Example: Correcting Error
• Receiver receives 10010100101

78
78
Chapter 1
FLOW AND ERROR CONTROL
The most important responsibilities of the data link
layer are flow control and error control. Collectively,
these functions are known as data link control.

Flow control refers to a set of procedures used to restrict


the amount of data that the sender can send before
waiting for acknowledgment.

Error control in the data link layer is based on


automatic repeat request, which is the
retransmission of data.

11.79
79
Chapter 1
Flow control techniques
• Stop and wait, Sliding window

1. STOP AND WAIT PROTOCOL


❖ Sender keeps a copy of the last frame until it receives
acknowledgement.

❖ For identification, both data frames and


acknowledgements (ACK) frames are numbered
alternatively 0 and 1.
❖ Sender starts a timer when it sends a frame. If an ACK is
not received within a allocated time period, the sender
assumes that the frame was lost or damaged and resends
it
❖ ACK number always defines the number of the next
expected frame

❖ DISADVANTAGE: Inefficiency (slow) 80


Chapter 1
Stop and Wait Protocol

• Idea of stop-and-wait protocol is straightforward

– After transmitting one frame, the sender waits for


an acknowledgement before transmitting the next
frame.

– If the acknowledgement does not arrive after a


certain period of time, the sender times out and
retransmits the original frame

81
Stop and Wait Protocol

Timeline showing four different scenarios for the stop-and-wait algorithm.


(a) The ACK is received before the timer expires; (b) the original frame is lost; (c) the
ACK is lost; (d) the timeout fires too soon
Chapter 1
Stop and Wait Protocol

• If the acknowledgment is lost or delayed in arriving


– The sender times out and retransmits the original frame, but the
receiver will think that it is the next frame since it has correctly
received and acknowledged the first frame
– As a result, duplicate copies of frames will be delivered

• Solution
– Use 1 bit sequence number (0 or 1)
– When the sender retransmits frame 0, the receiver can determine
that it is seeing a second copy of frame 0 rather than the first copy of
frame 1 and therefore can ignore it (the receiver still acknowledges it,
in case the first acknowledgement was lost)

83
Stop and Wait Protocol
Sliding Window Protocol

Timeline for Sliding Window Protocol


Chapter 1
SLIDING WINDOW PROTOCOL

• Allows the sender to transmit several frames at a time


before waiting for an acknowledgement .
• Senders window
• Receivers window

86
Chapter 1
ERROR CONTROL

87
Chapter 1
❖ERROR detection and correction
❖Allows the sender to know about damaged or lost
frame.
❖NAK (negative acknowledgement ) is sent when
an error is detected
❖STOP AND WAIT ARQ
❖It adds simple error control mechanism to stop
and wait protocol.
❖Lost acknowledgement (timer )

88
Chapter 1
89
Chapter 1
GO BACK N ARQ: Sender starts retransmission with the last
unacknowledged frame

90
Chapter 1
Damaged frame

91
Chapter 1
SELECTIVE REPEAT ARQ:
Specific damaged or lost frame is retransmitted

92
Applications
• Most people know about the Internet (a computer
network) through applications
– World Wide Web
– Email
– Online Social Network
– Streaming Audio Video
– File Sharing
– Instant Messaging

Anda mungkin juga menyukai