CNS Co1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 117

19CS2109

COMPUTER NETWORKS AND SECURITY

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 1
Session-2

Introduction

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
2
1.0 Technology Revolution

• 18th Century Mechanical systems


• 19th Century Steam Engine
• 20th Century Information
- gathering
- distribution
- processing
- creating

3
What is a Computer Network
◆A set of communication elements connected by
communication links
router
workstation
➭ Communication elements server
● Computers, printers, mobile phones, … mobile
● Routers, switches, ... local ISP
➭ Communication links
● optic fiber
● coaxial cable regional ISP
● twisted pair
● wireless (radio, microwave, satellite)

➭ Topologies
● Ring, Star, Bus, Tree, Mesh
company
4 network
What is a Computer Network
◆ A software/hardware infrastructure
➭ Share resources
● data, files, computing power, video,…

➭ Information highway
● communication between geographically dispersed users

➭ Electronic Society
● Cyberspace
● Virtual global nation

5
Introduction
⚫ Computer Network
– an interconnected collection of autonomous computers
Internet: “network of networks”
– loosely hierarchical
– public Internet versus private intranet
WWW a distributed systems run on the top of Internet
⚫ Distributed System
– High degree of cohesiveness and transparency
– A software system built on top of a network

6
1.1 Uses of Computer Networks

•Business Applications
•Home Applications
•Mobile Users
•Social Issues

7
Business Applications of Networks
a. Resource sharing (hardware, software, information, …)
b. Providing communication medium (e-mail, videoconferenceing)
c. Doing business electronically (B2B, B2C, e-commerce)

• A network with two clients and one server.

8
Goals of Networks for Companies
⚫ Resource sharing: equipment, programs, data
⚫ high reliability
– replicated data
– hardware
⚫ Saving money
– mainframe: 10 times faster, but 1000 times more expensive than PC
– client-server model
⚫ Scalability
– mainframe: replace a larger one
– client-server model: add more servers
⚫ Communication medium for separated employees
9
Business Applications of Networks (2)
a. Two processes are involved
b. A communication network is needed
• The client-server model involves requests and replies.

10
Session-3

Introduction

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
11
Home Network Applications

•Access to remote information


•Person-to-person communication
•Interactive entertainment
•Electronic commerce

12
⚫ Networks for People
– Access to remote information
• e.g.: financial, shopping, customized newspapers, on-line digital library,
WWW
– Person-to-person communication
• email, video conference, newsgroup
– Interactive entertainment
• VOD, interactive movies or TVs, game playing

13
Home Network Applications (2)
• In peer-to-peer system there are no fixed clients and servers.

14
Home Network Applications (3)
• Some forms of e-commerce.

15
Mobile Network Users
• Combinations of wireless networks and mobile computing.

mobile-commerce

16
Social Issues
•Politics
•Religion
•Sex
•Privacy
•Crime
•junk mail, ill-information
Each country has different laws.
Debate rages!

17
Session-4

Introduction

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
18
Network Hardware

•Local Area Networks


•Metropolitan Area Networks
•Wide Area Networks
•Wireless Networks
•Home Networks
•Internetworks

19
Network Hardware

• Types of transmission technology


•Broadcast links
•Point-to-point links

20
Network Hardware
– Broadcast networks
• single communication channel shared by all machines
• broadcasting or multicasting (via packets)
– broadcasting: a special code in address field
– multicasting: reserve one bit to indicate multicasting, the remaining n-1address
bits can hold a group number. Each machine can subscribe to any groups
• used by localized networks (or satellites)
– point-to-point networks
• many hops
• routing algorithms: multiple routs are possible
• used by large networks

21
Classification of interconnected processors by scale

22
Local Area Networks (LANs)
· Characterics of LANs: (a) privated-owned, (b) small size,
(c) transmission technology, (d) topology
· Ethernets are most popular (up to 10 Gb/s)

• Two broadcast networks


• (a) Bus
• (b) Ring 23
Local Area Networks
⚫ Characteristics
• small size
• transmission technology
• single cable
• 10Mbps ~ 10Gb/s
• 10Gb/s : 10,000,000.000 bps
• topology:
• bus
• Ethernet (IEEE 802.3): 10 or 100 Mbps (10Gb/s)
• ring
• IBM token ring (IEEE 802.5): 4 or 16 Mbps

⚫ Channel allocation of broadcast networks


• static: each machine has an allocated time slot
• dynamic

24
Metropolitan Area Networks
• A metropolitan area network based on cable TV.

25
Wide Area Networks (WANs)
·WANs are point-to-point networks
·WANs consist of two distinct components:
transmission lines (copper, fiber, microwave) and switches (electronics, optics)
 Store-and-forward or packet-switched subnet

• Relation between hosts on LANs and the subnet.


26
Network Topology

27
Subnet (WANs)
• Subnet (WANs) is consists of two components:
• transmission lines (circuits, channels, trunks)
• move bits between machines
• switching elements
• connect transmission lines
• Router: also called packet switching nodes, intermediate systems, and data switching
exchanges
• Operate in store-and-forward, or packet-switched mode.

28
Wide Area Networks (2)
• A stream of packets from sender to receiver. (virtual- circuit)

⚫ Routing decisions are made locally·


⚫ How A makes that decision is called the routing algorithm.
 Will be studied in detail in Chapter 5.

29
9/17 End
Wireless Networks

• Categories of wireless networks:


• System interconnection
(short-range radio, e.g. Bluetooth)
• Wireless LANs
(802.11a, 802.11b, 802.11g)
• Wireless WANs
(802.16, Cellular telephones, Satellites)
• Wireless sensor networks

30
Wireless Networks (2)

• (a) Bluetooth configuration


• (b) Wireless LAN
31
Wireless Networks (3)

• (a) Individual mobile computers


• (b) A flying LAN 32
Home Network Categories
⚫Computers (desktop PC, PDA, shared peripherals)
⚫Entertainment (TV, DVD, VCR, camera, stereo, MP3)
⚫Telecomm (telephone, cell phone, intercom, fax)
⚫Appliances (microwave, fridge, clock, furnace, airco., light)
⚫Telemetry (utility meter, smoke/burglar alarm, babycam).

33
⚫ Fundamentally different properties
1. Devices have to be easy to install
2. The network and devices have to be foolproof in
operation
3. Low price is essential
4. The network needs sufficient capacity ( for multimedia
application)
5. The network interface and wiring have to be stable for
many years
6. Security and reliability will be very important
(minimize false alarm or misalarm)
⚫ Home networks may be wired or wireless
34
Internetworks
• Internetworks connect networks with different hardware
• and software
• A collection of interconnected networks is called
• an internetwork or internet
• Internet is one specific internet
• Gateways are used to make the connection and to
• provide the necessary translation (protocol convertion)

35
Network Software
• Protocol Hierarchies (Layer structure)
• Design Issues for the Layers
• Connection-Oriented and Connectionless Services
• Service Primitives
• The Relationship of Services to Protocols

36
Network Software
• Protocol Hierarchies
• a series of layers (levels)
• lower layer provides service to higher layers
• protocol:
• an agreement between the communication parties on how communication is to
proceed
• Peers:
• the corresponding layers on different machines.
• Network architecture: a set of layers and protocols
• Protocol stack:
• a list of protocols used by a certain system, one protocol per layer

37
Network Software Virtual
Protocol Hierarchies Communication

→ Peer

Physical
Communication

• Layers, protocols, and interfaces.


Network Architecture: A set of layers and protocols
Protocol Stack: A list of protocols used by a certain system,
38 one protocol per layer.
Network Software
◆ Layering
➭ To make things simple: modularization
➭ Different layer has different functions
➭ Create layer boundary such that
● description of services can be small
● number of interactions across boundary are minimized
● potential for interface standardized

➭ Different level of abstraction in the handling of data (e.g.,


syntax, semantics)
➭ Provide appropriate services to upper layer
➭ Use service primitives of lower layer

39
Protocol Hierarchies (2)
• The philosopher-translator-secretary architecture.

40
Protocol Hierarchies (3)
Message segmentation Encapsulation
• Example information flow supporting virtual communication in layer 5.

41
Design Issues for the Layers

• Addressing (telephone number, e-mail address, IP address,…)


• Error Control (error correction codes, ARQ, HARQ,…)
• Flow Control (feedback-based, rate-based)
• Multiplexing (gathering several small messages with the same destination
into a single large message or vice versa → Demultiplexing)
• Routing (directing traffic to the destination)

42
Design Issues for Layers
⚫ Identify senders and receivers
– multiple computers and processes: addressing
⚫ Data transfer
– simplex, half-duplex, full-duplex communication
– # of logical channels per connections, priorities
⚫ Error control
– error detection
– error correction
⚫ Sequencing of pieces

43
Design Issues for Layers
⚫ Flow control
– feedback from the receiver
– agreed upon transmission rate
⚫ Length of messages
– long messages: disassemble, transmit, and reassmeble messages
– short messages: gather several small messages
⚫ Multiplexing and Demultiplexing
– when expensive to set up a separate connection
– needed in physical layer
⚫ Routing: split over two or more layers
– High level: London -> France or Germany -> Rome
– Low level: many available circuits
44
Connection-Oriented and Connectionless Services
• Six different types of service.

45
Service Primitives (Operations)
A service is formally defined by a set of primitives (operations) available to a user
process to access the services.

• Five service primitives for implementing a simple connection-oriented


service.
46
Service Primitives (2)
If the protocol stack is located in the operating system,
the primitives are normally system calls.

• Packets sent in a simple client-server interaction on a connection-


oriented network. 47
Services to Protocols Relationship
·The service defines what operations the layer is prepared to perform on behalf of its users
·A service is a set of primitives that a layer provides to the layer above it.
·A protocol is a set of rules governing the format and meaning of the packets which are
exchanged by the peer entities in the same layer.
Services related to the interfaces between layers;
 Protocols related to the packets sent between peer entities on different machine.
Service Users

Service Providers

• The relationship between a service and


48 a protocol.
Session-5-6

Reference Models

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
49
Reference Models

•The OSI(open system interconnection ISO) Reference Model


•The TCP/IP Reference Model
•A Comparison of OSI and TCP/IP
•A Critique of the OSI Model and Protocols
•A Critique of the TCP/IP Reference Model

50
The design principle of the OSI reference model
•A layer should be created where a different abstraction is needed
•Each layer should perform a well defined function
•The function of each layer can be chosen as an international standard
•The layer boundaries should be chosen to minimize the information
flow across the interfaces
•The number of layers should be not too large or not too small

51
Reference Models

The OSI
reference model.

52
The functions of the seven layers
• The physical layer is concerned with transmitting raw bit streams over a communication
channel BITS to SIGNALS,analog and digital
• The data link layer performs flow control and also transforms a raw transmission facility into a
line that appears error free (ARQ), error control and uses physical address(MAC),frames
• The network layer controls the operation of the subnet, e.g. routing, path determination,
packet transfer using logical addressing(IPv4,IPv6),masking, internetworking, packets
• The transport layer performs segmentation, flow-control and error-control. assembling and
disassembling, isolates the upper layers from the changes in the network hardware, and
determines the type of services (TCP,UDP)
The session layer establishes sessions , Establish , Manage & Terminate connection
ex: login & logout Authorization and Authentication
• The presentation layer is concerned with the Translation(syntax and semantics), Data
Compression, Encryption
• The application layer contains a variety of commonly used protocols (e.g. Hyper Text Transfer
Protocol for WWW, file transfer, e-mail, network news,…)
53
Reference Models (2)
• The TCP/IP reference model.

54
Reference Models (3)
• Protocols and networks in the TCP/IP model initially.

55
Comparing OSI and TCP/IP Models
•Concepts central to the OSI model
•Services: defines layer’s semantics
•Interfaces: tells the processes above it how to access it.
•Protocols

Probably the biggest contribution of the OSI model is to make the


distinction between these three concepts explicit.

56
A Critique of the OSI Model and Protocols

• Why OSI did not take over the world


•Bad timing
•Bad technology
•Bad implementations
•Bad politics

57
Bad Timing
• The apocalypse of the two elephants.

investment
opportunity

right time to
new discovery
make

58
Bad Technology
•The choice of seven layers was political
• - session and presentation layers are nearly empty
• - Data and network layers are overfull
•The OSI model is extraordinarily complex
•Some functions e.g. addressing, flow control, error control reappear
again and again

59
Bad Implementations
•Huge, Unwieldy, and Slow

•Bad Politics
•Bureaucrats involved too much (European telecommunication
ministries, community, us government)

60
A Critique of the TCP/IP Reference Model
• Problems:
• Service, interface, and protocol not distinguished
• Not a general model
• Host-to-network “layer” not really a layer (is an interface)
• No mention of physical and data link layers
• Minor protocols deeply entrenched, hard to replace
• (The virtual terminal protocol, TELNET, was designed for mechanical teletype
terminal)

61
Hybrid Model
• The hybrid reference model to be used in this book.

62
Session-7&8

Introduction

63
Data Link Layer Design Issues
•Services Provided to the Network Layer
•Framing
•Error Control
•Flow Control
•Access Control
Functions of the Data Link Layer
•Provide service interface to the network layer
•Dealing with transmission errors
•Regulating data flow
• Slow receivers not swamped by fast senders
• Frame management forms the heart of what data link layer does
Functions of the Data Link Layer (2)
Relationship between packets and frames.
Services Provided to Network Layer
• The function of the data link layer is to provide services to the network layer.
• The principal service is transferring data from the network layer on the source
machine to the network layer on the destination machine.
• The data link layer can be designed to offer various services. The actual services
offered can vary from system to system. Three reasonable possibilities that are
commonly provided are
➢ 1. Unacknowledged connectionless service.
➢ 2. Acknowledged connectionless service.
➢ 3. Acknowledged connection-oriented service.

© 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 67
Services Provided to Network Layer

(a) Virtual communication.


(b) Actual communication.
Framing
A character stream. (a) Without errors. (b) With one error.
Services Provided to Network Layer (2)
Placement of the data link protocol.
Framing:
• To provide service to the network layer, the data link layer must use the service provided to it by the physical
layer.

• What the physical layer does is accept a raw bit stream and attempt to deliver it to the destination. This bit
stream is not guaranteed to be error free.

• The usual approach is for the data link layer to break the bit stream up into discrete frames and compute
the checksum for each frame.

• Breaking the bit stream up into frames is more difficult than it at first appears. One way to achieve this
framing is to insert time gaps between frames, much like the spaces between words in ordinary text.

• Since it is too risky to count on timing to mark the start and end of each frame, other methods have been
devised. Now we will look at three methods:

➢ 1. Character count.

➢ 2. Flag bytes with byte stuffing.

➢ 3. Starting and ending flags, with bit stuffing.


© 2021 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 71
Framing (2)

(a) A frame delimited by flag bytes.


(b) Four examples of byte sequences before and after stuffing.
Framing (3)

Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after destuffing.
Error Detection and Correction

•Error-Correcting Codes
•Error-Detecting Codes
Error-Correcting Codes
Use of a Hamming code to correct burst errors.
Error-Detecting Codes

Calculation of the polynomial code checksum.


Session-9 and 10

Error Control

77
Error Detection and Correction
• Types of Errors

• Detection

• Error Correction
Error Detection and Correction

• Data can be corrupted during transmission. For reliable


communication, error must be detected and corrected
• Error Detection and Correction are implemented either at the data link
layer or the transport layer of the OSI model
Type of Errors
Type of Errors(cont’d)
• Single-Bit Error
~ is when only one bit in the data unit has changed.
Type of Errors(cont’d)
• Multiple-Bit Error
~ is when two or more
nonconsecutive bits in the data
unit have changed(ex : ASCII B -
ASCII LF)
Type of Errors(cont’d)
• Burst Error
~ means that 2 or more consecutive bits in the data unit have
changed
Detection
• Error detection uses the concept of redundancy, which means adding
extra bits for detecting errors at the destination
Detection(cont’d)
• Redundancy
Detection(cont’d)
• Detection methods
Detection(cont’d)
• Parity Check
• A parity bit is added to every data unit so that the total number of 1s(including the parity bit)
becomes even for even-parity check or odd for odd-parity check
• Simple parity check
Detection -examples

Example 1
Suppose the sender wants to send the word world.
In ASCII the five characters are coded as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
Detection -examples

Example 2
Now suppose the word world in Example 1 is received by the receiver without
being corrupted in transmission.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up with even numbers
(6, 6, 4, 4, 4). The data are accepted.
Detection -examples

Example 3
Now suppose the word world in Example 1 is corrupted during transmission.
11111110 11011110 11101100 11011000 11001001
The receiver counts the 1s in each character and comes up with even and odd
numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards
them, and asks for retransmission.
Two –Dimensional Parity Check
Detection - example

Example 4
Suppose the following block is sent:
10101001 00111001 11011101 11100111 10101010
However, it is hit by a burst noise of length 8, and some bits are corrupted.
10100011 10001001 11011101 11100111 10101010
When the receiver checks the parity bits, some of the bits do not follow the
even-parity rule and the whole block is discarded.
10100011 10001001 11011101 11100111 10101010
Detection(cont’d)
• CRC(Cyclic Redundancy Check)
~ is based on binary division.
Detection(cont’d)
• CRC generator
~ uses modular-2
division.

Binary Division
in a
CRC Generator
Detection(cont’d)
• Polynomials
• CRC generator(divisor) is most often represented not as a string of 1s and 0s,
but as an algebraic polynomial.
Detection(cont’d)
• A polynomial representing a divisor
Detection(cont’d)
• Standard polynomials
Detection(cont’d)
• Checksum
~ used by the higher layer protocols
~ is based on the concept of redundancy(VRC, LRC, CRC ….)
Detection(cont’d)
• Checksum Generator
Detection(cont’d)
• To create the checksum the sender does the following:
• The unit is divided into K sections, each of n bits.
• Section 1 and 2 are added together using one’s complement.
• Section 3 is added to the result of the previous step.
• Section 4 is added to the result of the previous step.
• The process repeats until section k is added to the result of the previous step.
• The final result is complemented to make the checksum.
Detection(cont’d)
• data unit and checksum
Detection(cont’d)
Detection(cont’d)
• Example ( at a sender)
Original data : 10101001 00111001
10101001
00111001
--------------
11100010 Sum
00011101 Checksum
10101001 00111001 00011101
Detection(cont’d)
• Example ( at a receiver)
Received data : 10101001 00111001 00011101
10101001
00111001
00011101
---------------
11111111  Sum
00000000  Complement
Error Correction
Error correction can be handled in two ways

• when an error is discovered, the receiver can have the sender


retransmit the entire data unit.

• a receiver can use an error-correcting code, which automatically


corrects certain errors.
Error Correction(cont’d)
• Single-Bit Error Correction
• parity bit
• The secret of error correction is to locate the invalid bit or bits
• For ASCII code, it needs a three-bit redundancy code(000-111)
Error Correction(cont’d)
• Redundancy Bits
~ to calculate the number of redundancy bits (R) required to
correct a given number of data bit (M)
Error Correction(cont’d)
• 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 states
r
2 m+r+1

ex) For value of m is 7(ASCII), the smallest r value that can satisfy this
equation is 4
24  7 + 4 + 1
Error Correction(cont’d)
Relationship between data and redundancy bits
Error Correction(cont’d)
• Hamming Code
~ developed by R.W.Hamming
• positions of redundancy bits in Hamming code
Error Correction(cont’d)
• each r bit is the VRC bit for one combination of data bits
r1 = bits 1, 3, 5, 7, 9, 11
r2 = bits 2, 3, 6, 7, 10, 11
r4 = bits 4, 5, 6, 7
r8 = bits 8, 9, 10, 11
Error Correction(cont’d)
Redundancy bits calculation(cont’d)
Error Correction(cont’d)
Redundancy bits calculation(cont’d)
Error Correction(cont’d)
Calculating the r values
Error Correction(cont’d)
Error Detection and Correction
Error Correction(cont’d)

• Error detection using Hamming Code


Error Correction(cont’d)
• Multiple-Bit Error Correction
• redundancy bits calculated on overlapping sets of data units can also be used
to correct multiple-bit errors.
Ex) to correct double-bit errors, we must take into consideration that two bits
can be a combination of any two bits in the entire sequence

You might also like