Saturday 16 December 2017

Computer Network last Minute Notes


Switching:
Circuit switched network(use switch to only forward message)
Packet switched network(use router to store and forward network)

Internet: one can connect to internet by various means
  1. Using telephone lines(Dialup and DSL services
  2. Using cable networks
  3. Using wireless network

FCC(federal communication commision has authority over interstate and international commerce in the communications field )

Network Model : Two principles
First, each layer needs to perform two opposite tasks.
Second, two objects under each layer at both sides should be identical.

  • The OSI model appeared after the TCP/IP protocol suite

    Physical Layer

1.    A time-domain graph plots amplitude as a function of time.
2.     A frequency-domain graph plots each sine wave peak amplitude against its frequency     
3.    a sine wave is defined by three characteristics: amplitude, frequency, and phase     

Analog Signal
  • Frequency is number of period  completed in a second
  • Wavelength is distance a simple signal travel in a second
  •  
    • wavelength(lenda)=propagation speed(v)*time(t) 
    • λ =c*t = c/f(frequency) 
  • The bandwidth of a composite signal is the difference between the highest and the lowest frequencies contained in that signal
  • Only periodic signal can be used in analog data communication

Digital Signal
  •  Bit rate is number of bits sent in 1 second. Expressed in bits per second(bps)
  • Bit length is the distance one bit occupies on the transmission medium
  • Bit length = propagation speed *  bit duration
  • Only non periodic signal can be used in digital data communication

Digital signal can be transmitted using two method-baseband and broadband  
  • Baseband transmission means sending a digital signal over a channel without changing the digital signal to an analog signal    
  • Broadband transmission or modulation means changing the digital signal to an analog signal for transmission. 

Transmission Impairment
  1. Attenuation (loss of energy) db=10*log p2/p1
  2. Distortion
  3. Noise
Signal to noise ratio (SNR)=average signal power/average noise power

Data Rate Limit
Shannon capacity for noise channel = bandwidth*log2(1+SNR)  
Noiseless Channel: Nyquist Bit Rate = 2 * bandwidth * log2L  L is number of signal level
   
 
   Digital Transmission

Data Rate Versus Signal Rate
The data rate defines the number of data elements (bits) sent in 1s. The unit is bits per
second (bps). The signal rate is the number of signal elements sent in 1s. The unit is
the baud. There are several common terminologies used in the literature. The data rate
is sometimes called the bit rate; the signal rate is sometimes called the pulse rate, the
modulation rate, or the baud rate.

Three technique to convert digital data to digital signal.- Line coding,Block coding,Scrambling
Two technique to convert analog signal to digital data-Pulse code modulation,delta modulation

Transmission Modes--Parallel and Serial(Synchronous, Asynchronous, Isochronous )
In asynchronous transmission, we send 1 start bit (0) at the beginning and 1 or more stop bits (1s) at the end of each byte. In synchronous transmission, we send bits one after another without
start or stop bits or gaps. It is the responsibility of the receiver to group the bits.

Analog Transmission

Four techniques to convert digital data to analog signal-amplitude shift keying (ASK), frequency shift keying (FSK), and phase shift keying (PSK), Quadrature amplitude modulation
Three techniques to convert analog signal to analog Data- Frequency modulation,amplitude modulation, Phase modulation

Multiplexing:
 FDM-frequency division multiplexing -FDM is used in AM,FM radio broadcasting
1.    A special band from 530 to 1700 kHz is assigned to AM radio. All radio stations need to share this band. AM station needs 10 kHz of bandwidth
2.    FM has a wider band of 88 to 108 MHz because each station needs a bandwidth of 200 kHz.
3.    Each TV channel has its own bandwidth of 6MHz

  
WDM-Wave division multiplexing--WDM is an analog multiplexing technique to combine optical signals.One application of WDM is sonnet network
TDM-Time division multiplexing- two types
Synchronous TDM-allocates time slot for each source even if source is transmitting any signal
Statistical TDM-allocates time dynamically according to source requirement
Spreading.privacy and anti jamming can be achieved by using spreading
Two technique of spreading-frequency hopping spread spectrum (FHSS), Direct Sequence spread spectrum (DSSS)
    Transmission Media
 Guided Media
  1. Twisted Pair cable(Connector-RJ45 Male and Female)
  2. Coaxial cable(BNC connector ,BNC T, BNC Terminator) 
  3. Fiber Cable(MT RJ)
Propagation Method
  1. Ground Propagation(below 2MHz)
  2. Sky Propagation(2-30MHz)
  3. Line of sight Propagation(Above 30MHz)

UnGuided Media:wireless transmission can be divided into three category radio,micro and infrared waves  
Radio waves-Omnidirectional (upto 1GHz- used in Radio,TV,Paging system)
Microwaves-Unidirectional (1-300 GHz-used in Cellular Phone,Satellite Network, LAN’s)
Infrared waves-(300 GHz to 400GHz) used in short range communication)

Switching
Three type of switching
Circuit switching(setup--transfer-tore down) -used in Physical layer
Packet switching
Virtual Packet Switching-data link layer
Datagram Packet switching -Network Layer
Message Switching -used at application level 


Data Link Layer

Three types of address unicast ,multicast(one to many),broadcast(One to All)

Error Detection and Correction
Data Link Control
DLC is responsible for framing ,flow and error control
Two protocol to pack data bits into variable frame-character oriented approach and bit oriented approach
  • Byte/Bit stuffing is the process of adding one extra byte/bit whenever there is a flag or escape character in the text.
  •  

HDLC(High Level Data Link Control): High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the Stop-and-Wait protocol.HDLC provides two types of transfer modes.
NRM-normal response mode:In NRM ,primary station sends command to one more station and secondary station can only respond.
ABM-Asynchronous balanced mode-used for point to point communication where both peer can send command and response
HDLC defines three types of frames: information frames (I-frames), supervisory frames (S-frames), and unnumbered frames (U-frames).

PPP(Point to Point protocol):


Media Access Control(MAC)
Multiple-access protocols
Random-access protocols
  1. ALOHA
    1. Pure Aloha (efficiency is 18.6)
    2. Slotted Aloha(efficiency is 36.8) 
  1. CSMA/CD
  2. CSMA 
Channelization Protocol
  1. CSMA/CA
  2. FDMA
  3. TDMA
  4. CDMA
Controlled-access protocols
  1.  Polling
  2. Token passing
  3. Reservation  
Ethernet  
The IEEE 802.3 Standard defines 1-persistent CSMA/CD as the access method for first-generation 10-Mbps Ethernet. The data-link layer of Ethernet consists of the LLC sublayer and the MAC sublayer.
Each station on an Ethernet network has a unique 48-bit address imprinted on its network interface card (NIC). The minimum frame length for 10-Mbps Ethernet is 64 bytes; the maximum is 1518 bytes. The common implementations of 10-Mbps Ethernet are 10Base5 (thick Ethernet), 10Base2 (thin Ethernet), 10Base-T (twisted-pair Ethernet), and 10Base-F (fiber Ethernet).  

Other wired network
Telephone Network: Plain old telephone system(POTS): 
LATAs local access transport areas
Dial up service and Digital Subscriber Line is used for transmitting data over telephone line
Cable Network-community antenna television (CATV) network 
Synchronous Optical Network (SONET) developed by ANSI- used to connect WAN and higher data transfer lines SONET defines four layers: path, line, section(first three incorporated in data link layer), and photonic(Physical Network).  We can roughly divide SONET networks into three categories: linear, ring, and mesh networks
ATM:Asynchronous Transfer Mode (ATM) is a switched wide area network based on the cell relay protocol designed by the ATM forum and adopted by the ITU-T .ATM header is of 5 Byte and payload is of 48 bytes.

Wireless LANs
802.11(Wireless LAN also known as Wireless fidelity -wifi)-two types of architecture . two services: basic service set (BSS) and extended service set (ESS).
Ad Hoc network(without Access point) ,infrastructure network(with AP)
Bluetooth:A Bluetooth network is called a piconet, or a small net. A piconet can have up to eight stations, one of which is called the primary; the rest are called secondaries . Piconets can be combined to form what is called a scatternet. Logical Link Control and Adaptation Protocol, or L2CAP (L2 here means LL), is roughly equivalent to the LLC sublayer in LANs. The baseband layer is roughly equivalent to the MAC sublayer in LANs. The access method is TDMA . Radio layer is equivalent to physical layer .

Other Wireless Network        
Worldwide Interoperability for Microwave Access (WiMAX) First, 802.11 is a standard for a wireless LAN; 802.16 is a standard for a wireless WAN (or MAN). The distance between a base station and a host in the first is very limited; the base station and subscriber station in the second may be separated by tens of kilometers. Project 802.11 defines a connectionless communication; project 802.16 defines a connection- oriented service.    
A later revision of IEEE 802.16 created two new standards called IEEE 802.16d, which concentrates on the fixed WiMAX, and IEEE 802.16e, which defines the mobile WiMAX.

AMPS-advanced mobile phone system
GSM is digital cellular phone using TDMA and FDMA and was invented in Europe during 2nd generation
Universal Mobile Telecommunications System (UMTS)

Connecting Devices  
HUB- Physical Layer
Switching Network- Physical Layer,Data link Layer 
Router- Physical Layer,Data link Layer,Network Layer

 Network Layer

The main services provided by the network layer are packetizing and routing the packet from the source to the destination. The network layer in the Internet does not seriously address other services such as flow, error, or congestion control.
Packet switching. There are two approaches to packet switching: datagram approach and virtual-circuit approach.

DHCP works at network layer and operate on port 67,68
 Network Address Translation (NAT).  A technology that can provide the mapping between the private and universal addresses, and at the same time support virtual private networks,is Network Address Translation (NAT).


Network-Layer Protocols

Four protocol is used in Network layer-IP,ARP,IGMP,ICMP
IP header is of 20-64 bytes and packet length is upto 65536 bytes
ICMPv4-this is designed to compensate error and  host-network management queries
Message is divided in two part-error reporting and query message
Two tools ICMP uses for debugging-ping and traceroute

Routing  
Unicast Routing
Distance vector Routing-Warshall algorithm-Routing information protocol(RIP)
Link state routing-Dijkstra's Algo-Open shortest path first(OSPF)
Path vector routing-Spanning tree- Border Gateway Protocol(BGP)
Multicast Routing        
In classless addressing the block 224.0.0.0/4 is used for multicast addressing

Transport Layer
Services provided by transport layer
  1. Process to Process communication
  2. Port Addressing(Well known:0-1023,Registered:1024-49151,Dynamic:49152-65535)
  3. Encapsulation and decapsulation
  4. Multiplexing and demultiplexing 
  5. Flow control 
Combination of port and IP address is called socket address
Protocol at Transport Layer
  1. Stop and wait 
  2. Go back N Protocol 
  3. Selective Repeat Protocol 
  4. Piggybacking 

UDP: UDP datagram header is of 8 byte(2 byte each for source port and destination port,2 for checksum,2 for packet length)
UDP is basically used in real time application such as DNS,SNMP,RIP. It can not be used in FTP,SMTP.
TCP- TCP segment header vary from 8 to 20 bytes .
A connection establishment in TCP is called three-way-handshaking(Connection establishment,data transfer, connection termination

Application Layer Applications in the Internet are designed using either a client-server paradigm or a peer-to-peer paradigm
Standard Client Server protocol The idea of the Web was first proposed by Tim Berners-Lee in 1989 at CERN- European Organization for Nuclear Research.
HTTP(port80) uses the services of TCP
FTP uses two well-known TCP ports: port 21 is used for the control connection, and port 20 is used for the data connection.

SMTP:used to transfer mail between mail server-25
POP/IMAP4(Internet mail access protocol)-used to retrieve mail from server-110/143
MIME Multipurpose Internet mail extension
TELNET(Terminal Network)is used for remote login-23
SSH(Secure shell)was designed to replace telnet and used for remote login and FTP-22
DNS mapping name to address to known as  name address resolution-153
SNMP Simple Network Management Protocol (SNMP) 161 is a framework for managing
devices in an internet using the TCP/IP protocol suite.The five areas comprising network management are configuration management, fault management, performance management, accounting management, and security management

Cryptography

Cryptography Algorithms can be categorized into part

Symmetric Cryptography(Secret key) -- Sender and receiver uses the same key and algorithm
Asymmetric Cryptography(Public key)—Sender uses public key and receiver private key

Traditional Encryption
Modern Encryption

SYMMETRIC Key Algorithm Types

Data Encryption Standard (DES)   
The algorithm encrypts a 64-bit plaintext block using a 64-bit key

Advanced Encryption Standard (AES)

AES Configurations
size of data block
number of round
Key Size
128 bits
10
128
12
196
14
256

ASYMMETRIC Key Algorithm Types

RSA and Diffie-Hellman.
RSA(Rivest, Shamir,and Adleman (RSA).
e and n shared to public and d ,fi kept secret.
P and Q are two large prime
n=P*Q
d*e(random integer)=1mod fi

fi=(P-1)(Q-1)
C=P^e (mod)n
P= C^d(mod)n

A combination of an encryption algorithm and a decryption algorithm is called a cipher.

Network Security:
Message
  • Confidentiality
  • NonRepudiation 
  • Integrity 
  • Authentication 
Entity
  • Authorisation
Security in Internet
Internet Engineering Task Force (IETF)

IPSecurity(IPSec) : Applied to network layer
Two modes of IPSec
1.Transport mode: protects only IP payload . applicable to end to end encryption(host to host)
2.Tunnel mode: protects to whole IP packet.applicable to router to router or router to host or host to router

Two types of protocol
Two types of security protocol
  1. Authentication Header Protocol(AH):provide authentication at IP level
  2. Encapsulating Security Protocol:provide authentication and encryption at IP level
Application of ISec is VPN which uses ESP protocol

Transport layer Security(SSL/TSL)
Ssl is designed to provide security and compression services to Transport layer protocol.ssl use four protocol to accomplish its task
1.handshake protocol
2.ChangeCipherSpec Protocol
3.Alert Protocol
4.Record Protocol

Application Layer Security(PGP and S/MIME)
Pretty Good Privacy (PGP). (PGPs invented by Phil Zimmermann to provide)
Secure/Multipurpose Internet Mail Extension (S/MIME). The protocol is an enhancement of the Multipurpose Internet Mail Extension (MIME)

Firewall:A firewall is a device (usually a router or a computer) installed between the internal network of an organization and the rest of the Internet. It is designed to forward some packets and filter (not forward) others
Two types of firewall
Packet Filter firewall Filter only network and Transport Layer
Proxy Filter Firewall (Application Gateway) filter the application layer

Cryptographic Message Syntax (CMS)
Internet Key Exchange (IKE)
Internet Security Association and Key Management Protocol (ISAKMP)
Points
1.     combination of key exchange, hash, and encryption algorithms defines a Cipher suite