1 computer networks-1 (btcs-403) by baljinder singh assistant professor (i.t) beant college of engg....

81
1 COMPUTER NETWORKS-1 COMPUTER NETWORKS-1 (BTCS-403) (BTCS-403) By Baljinder Singh Baljinder Singh Assistant Professor (I.T) Assistant Professor (I.T) Beant College of Engg. & Technology, Beant College of Engg. & Technology, Gurdaspur Gurdaspur

Upload: danna-stitcher

Post on 29-Mar-2015

225 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

1

COMPUTER NETWORKS-1COMPUTER NETWORKS-1

(BTCS-403)(BTCS-403)

By

Baljinder SinghBaljinder SinghAssistant Professor (I.T)Assistant Professor (I.T)

Beant College of Engg. & Technology, GurdaspurBeant College of Engg. & Technology, Gurdaspur

Page 2: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

2

CONTENTSCONTENTS Introduction Computer Networks OSI & TCP/IP Reference Model Layering, TCP/IP, Internet Addresses, DNS, Client

Server Model, Port Numbers. Link Layer Ethernet & IEEE 802( SLIP, PPP).

Page 3: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

3

INTRODUCTIONINTRODUCTION

Page 4: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

4

Computer NetworkComputer Network

A computer n/w is a group of communicating entities that uses a common network protocol to exchange data and share resources with each other over a communication medium. These communicating entities can be differentiated into end systems or intermediate systems.

End System(Computer, Telephone, Laptop, etc…) Intermediate System(Repeater, Hub, Bridges, Router)

Page 5: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

5

Contt…Contt…

Computer Network can be classified into different types on the basis of the….

Geographical Extent(LAN, MAN, WAN). Physical Interconnection of hosts(Network

Topologies(Bus, Ring, Star, Tree, Mesh). Type of communication path used Manner of data transmission among hosts over this

communication path.

Page 6: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

6

Uses of Computer NetworksUses of Computer Networks

• Resource Sharing• Communication Medium• Reliability• Scalability• Money Saving• E-Commerce• Online Banking Etc.

Page 7: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

7

Business Applications of NetworksBusiness Applications of Networks

A network with two clients and one server.

Page 8: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

8

Business Applications of Networks (2)

The client-server model involves requests and replies.

Page 9: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

9

Mobile Network Users

Wireless Mobile Applications

No No Desktop PCs in Offices

No Yes A Laptop used in a hotel room to access internet

Yes No Network in an older unwired building

Yes Yes Portable Office / Mobile Office/ Internet on laptops through Wireless connectivity in a Campus

Page 10: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

10

Types of Networks

• Local Area Networks• Metropolitan Area Networks• Wide Area Networks• Wireless Networks

Page 11: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

11

Broadcast Networks

Types of transmission technology• Broadcast links• Point-to-point links

Page 12: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

12

Classification of interconnected processors by scale.

Page 13: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

13

Local Area Networks

Two broadcast networks

(a) Bus (b) Ring

Page 14: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

14

Metropolitan Area NetworksMetropolitan Area Networks

A metropolitan area network based on cable TV.

Page 15: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

15

Wide Area Networks

Relation between hosts on LANs and the subnet.

Page 16: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

16

Wide Area Networks (2)Wide Area Networks (2)

A stream of packets from sender to A stream of packets from sender to receiver.receiver.

Page 17: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

17

Wireless Networks

Categories of wireless networks:• System interconnection• Wireless LANs• Wireless WANs

Page 18: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

18

Wireless Networks (2)Wireless Networks (2)

(a) Bluetooth configuration (b) Wireless LAN

Page 19: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

19

Network Software• Protocol HierarchiesProtocol Hierarchies• Design Issues for the LayersDesign Issues for the Layers• Connection-Oriented and Connectionless Connection-Oriented and Connectionless

ServicesServices• Service PrimitivesService Primitives• The Relationship of Services to ProtocolsThe Relationship of Services to Protocols

Page 20: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

20

Network SoftwareProtocol Hierarchies

Layers, protocols, and interfaces.

Page 21: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

21

Design Issues for the Layers

• Addressing• Error Control• Flow Control• Multiplexing• Routing

Page 22: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

22

Services to Protocols RelationshipServices to Protocols Relationship

The relationship between a service and a protocol.

Page 23: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

23

Reference Models

• The OSI Reference Model• The TCP/IP Reference Model

Page 24: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

24

Reference Models

The OSI Reference Model.

Page 25: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

25

Network Communication ProtocolsNetwork Communication Protocols In order to standardize these protocols and also to provide a

framework for their development, some standard reference models were developed. These network models are based on the concept of layering.

The n/w protocols are structured into set of layers, with each layer responsible for a different fact of communication.

A layered architecture lies in the ability to independently design, build or modify the functions and services of each layer without effecting the other layers.

It reduces the complexity of n/w operations by dividing them into simpler components

It also enable multi-vendor integration by dividing standard interfaces.

Page 26: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

26

Protocols & StandardsProtocols & Standards A protocol is a set of rules that govern data communication. A

protocol define what is communicated, how it is communicated & when to communicated. Key elements are.

1. Syntax

2. Semantics

3. Timing Syntax refers to structure or format of the data, order they presented.

1st 8-bit address of sender 2nd 8-bit address of receiver Rest of stream of message

Semantics refers to the meaning of each section of bits, how is particular pattern interpreted.

Timing refers two things:-

1. When data should be sent

2. How fast it can be send.

Page 27: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

27

Contt…Contt… Standards are essentials in creating and maintaining an open

and competitive market for equipment manufacturers and also in guaranteeing national & international inter operability of data & telecommunications technology & processes. There are two types

de-facto(By fact or by convention) de-jure(By law by regulation) RFCs(Request for Comment)

All the official standards in the internet community are published as RFC. Additionally there are lot of RFCs that are not official standards but published for information purposes. Each RFC ranges from 1 page to almost 200 pages. Each RFC is identified by a number.

Page 28: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

28

OSI

REFERENCE MODEL

Page 29: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

29

Communication ArchitectureStrategy for connecting host computers and other communicating equipment.

Defines necessary elements for data communication between devices.

A communication architecture, therefore, defines a standard for the communicating hosts.

A programmer formats data in a manner defined by the communication architecture and passes it on to the communication software.

Separating communication functions adds flexibility, for example, we do not need to modify the entire host software to include more communication devices.

Page 30: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

30

Layer Architecture

Layer architecture simplifies the network design.

It is easy to debug network applications in a layered architecture network.

The network management is easier due to the layered architecture.

Network layers follow a set of rules, called protocol.

The protocol defines the format of the data being exchanged, and the control and timing for the handshake between layers.

Page 31: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

31

Open Systems Interconnection (OSI) Model

International standard organization (ISO) established a committee in 1977 to develop an architecture for computer communication.

Open Systems Interconnection (OSI) reference model is the result of this effort.

In 1984, the Open Systems Interconnection (OSI) reference model was approved as an international standard for communications architecture.

Term “open” denotes the ability to connect any two systems which conform to the reference model and associated standards.

Page 32: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

32

OSI Reference Model

The OSI model is now considered the primary Architectural model for inter-computer communications.

The OSI model describes how information or data makes its way from application programmes (such as spreadsheets) through a network medium (such as wire) to another application programme located on another network.

The OSI reference model divides the problem of moving information between computers over a network medium into SEVEN smaller and more manageable problems .

This separation into smaller more manageable functions is known as layering.

Page 33: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

33

OSI Reference Model: 7 Layers

OSI Model

Page 34: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

34

Layer Responsible For:

7.) Application Provides Services to User Apps

6.) Presentation Data Representation

5.) Session Communication Between Hosts

4.) Transport Flow Ctrl, Error Detection/Correction

3.) Network End to End Delivery, Logical Addr

2.) Data Link Media Access Ctrl, Physical Addr

1.) Physical Medium, Interfaces, Puts Bits on Med.

Page 35: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

35

Layer Example

7.) Application HTTP, FTP, SMTP

6.) Presentation ASCII, JPEG, PGP

5.) Session BOOTP, NetBIOS, DHCP, DNS

4.) Transport TCP, UDP, SPX

3.) Network IP, IPX, ICMP

2.) Data Link Ethernet, Token Ring, Frame Relay

1.) Physical Bits, Interfaces, Hubs

Page 36: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

36

OSI: A Layered Network Model

The process of breaking up the functions or tasks of networking into layers reduces complexity.

Each layer provides a service to the layer above it in the protocol specification.

Each layer communicates with the same layer’s software or hardware on other computers.

The lower 4 layers (transport, network, data link and physical —Layers 4, 3, 2, and 1) are concerned with the flow of data from end to end through the network.

The upper four layers of the OSI model (application, presentation and session—Layers 7, 6 and 5) are orientated more toward services to the applications.

Data is Encapsulated with the necessary protocol information as it moves down the layers before network transit.

OSI Model

Page 37: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

37

The OSI ModelThe OSI Model

Physical

Link

Network

Transport

Session

Presentation

Application

Unreliable Wire, Telco Line

Reliable Across Physical Line

Unreliable Thru Multi-Node Network

Reliable End to End

Sync Points and Dialogs

Data Representation & Syntax

User Level Processing

RS232, T1, 802.x

LAPB, HDLC

X.25 Pkt, IP

TCP

ISO Session

ISO Presentation

Telnet, FTP, Mail

Layer Name Description Examples

Page 38: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

38

The OSI Model

The Standards

Physical

Link

Network

Transport

Session

Presentation

Application

Unreliable Wire, Telco Line

Reliable Across Physical Line

X.25 Pkt, Q.931, IP

X.224, TCP

X.225

ASN.1, X.409

X.400, Telnet, FTP, Mail

Layer Name Standards

Unreliable Wire, Telco Line

X.25 LAPB, Q.921 LAPD, ISO 3309 HDLC

RS232, V.35, EIA530, X.21, T1, E1

Page 39: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

39

Physical Layer

Provides physical interface for transmission of information.

Defines rules by which bits are passed from one system to another on a physical communication medium.

Covers all - mechanical, electrical, functional and procedural - aspects for physical communication.

Such characteristics as voltage levels, timing of voltage changes, physical data rates, maximum transmission distances, physical connectors, and other similar attributes are defined by physical layer specifications.

OSI Model

Page 40: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

40

Data Link LayerData Link Layer

Data link layer attempts to provide reliable communication over the physical layer interface. Breaks the outgoing data into frames and reassemble the received frames.Create and detect frame boundaries.Handle errors by implementing an acknowledgement and retransmission scheme.Implement flow control.Supports points-to-point as well as broadcast communication.Supports simplex, half-duplex or full-duplex communication.

OSI Model

Page 41: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

41

Network LayerNetwork Layer

Implements routing of frames (packets) through the network.

Defines the most optimum path the packet should take from the source to the destination

Defines logical addressing so that any endpoint can be identified.

Handles congestion in the network.

Facilitates interconnection between heterogeneous networks (Internetworking).

The network layer also defines how to fragment a packet into smaller packets to accommodate different media.

OSI Model

Page 42: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

42

Transport Layer

Purpose of this layer is to provide a reliable mechanism for the exchange of data between two processes in different computers.

Ensures that the data units are delivered error free.

Ensures that data units are delivered in sequence.

Ensures that there is no loss or duplication of data units.

Provides connectionless or connection oriented service.

Provides for the connection management.

Multiplex multiple connection over a single channel.

OSI Model

Page 43: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

43

Session Layer

Session layer provides mechanism for controlling the dialogue between the two end systems. It defines how to start, control and end conversations (called sessions) between applications.This layer requests for a logical connection to be established on an end-user’s request.Any necessary log-on or password validation is also handled by this layer.Session layer is also responsible for terminating the connection.This layer provides services like dialogue discipline which can be full duplex or half duplex.Session layer can also provide check-pointing mechanism such that if a failure of some sort occurs between checkpoints, all data can be retransmitted from the last checkpoint.

OSI Model

Page 44: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

44

Presentation Layer

Presentation layer defines the format in which the data is to be exchanged between the two communicating entities.

Also handles data compression and data encryption (cryptography).

OSI Model

Page 45: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

45

Application Layer

1. Application layer interacts with application programs and is the highest level of OSI model.

2. Application layer contains management functions to support distributed applications.

3. Examples of application layer are applications such as file transfer, electronic mail, remote login etc.

OSI Model

Page 46: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

46

OSI in Action

A message begins at the top application layer and moves down the OSI layers to the bottom physical layer.

As the message descends, each successive OSI model layer adds a header to it.

A header is layer-specific information that basically explains what functions the layer carried out.

Conversely, at the receiving end, headers are striped from the message as it travels up the corresponding layers.

OSI Model

Page 47: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

47

OSI & TCP/IP Models

TCP/IP Model

Page 48: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

48

TCP/IP

PROTOCOL SUITE

Page 49: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

49

Introduction Introduction The TCP/IP protocol suite allows computers of all

sizes, from many different computer vendors, running totally different operating systems, to communicate with each other. What started in the late 1960s as a government-financed research project into packet switching networks has, in the 1990s, turned into the most widely used form of networking between computers.

It forms the basis for what is called the worldwide Internet, or the Internet, a wide area network (WAN) of more than one million computers that literally spans the globe.

Page 50: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

50

TCP/IP Model

Application LayerApplication programs using the network

Transport Layer (TCP/UDP)Management of end-to-end message transmission,

error detection and error correction

Network Layer (IP)Handling of datagrams : routing and congestion

Data Link LayerManagement of cost effective and reliable data delivery,

access to physical networks

Physical LayerPhysical Media

Page 51: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

51

TCP/IP ModelTCP/IP Model

Application

UDP TCP

ICMP IP

ARP RARP

Datalink

Physical

MessageSegment

Datagram

FrameBit

54

3

21

Page 52: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

52

Layering Layering

Networking protocols are normally developed in layers, with each layer responsible for a different facet of the communications. A protocol suite, such as TCP/IP, is the combination of different protocols at various layers. TCP/IP is normally considered to be a 4-layer system, as shown in Figure.

Figure The four layers of the TCP/IP protocol suite.

Application Telnet, FTP, e-mail, etc.

Transport TCP, UDP

Network IP, ICMP, IGMP

Link Device driver and interface card

Page 53: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

53

TCP/IP Layering TCP/IP Layering

Page 54: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

54

Conttd…Conttd… Each layer has a different responsibility.1. The link layer, sometimes called the data-link layer

or network interface layer, normally includes the device driver in the operating system and the corresponding network interface card in the computer. Together they handle all the hardware details of physically interfacing with the cable (or whatever type of media is being used).

2. The network layer (sometimes called the internet layer) handles the movement of packets around the network. Routing of packets, for example, takes place here. IP (Internet Protocol), ICMP (Internet Control Message Protocol), and IGMP (Internet Group Management Protocol) provide the network layer in the TCP/IP protocol suite.

Page 55: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

55

Conttd…Conttd…3. The transport layer provides a flow of data between

two hosts, for the application layer above. In the TCP/IP protocol suite there are two vastly different transport protocols: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).

4. The application layer handles the details of the particular application. There are many common TCP/IP applications that almost every implementation provides:

Telnet for remote login, FTP, the File Transfer Protocol, SMTP, Simple Mail Transfer protocol, for electronic mail, SNMP, the Simple Network Management Protocol,

Page 56: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

56

Fig :- Two hosts on a LAN running FTP.

Page 57: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

57

Fig :- Two n/w connected with router

FTP server

TCP

IP

Token Ring Driver

FTP client

TCP

IP

Host A Host B

Ethernet Driver

Token Ring

Router

IP

ethdrv

t.r.drv

Ethernet

TCP Protocol

FTP Protocol

Page 58: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

58

Internet AddressesInternet Addresses Every interface on an internet must have a unique

Internet address (also called an IP address). These addresses are 32-bit numbers. Instead of using a flat address space such as 1, 2, 3, and so on, there is a structure to Internet addresses. These 32-bit addresses are normally written as four decimal numbers, one for each byte of the address. This is called dotted-decimal notation.

For example, the class B address of system is 140.252.13.33.The easiest way to differentiate between the different classes of addresses is to look at the first number of a dotted-decimal address.

Page 59: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

59

Conttd…Conttd… Every interface on an internet must have a unique IP address,

there must be one central authority for allocating these addresses for networks connected to the worldwide Internet. That authority is the Internet Network Information Center, called the InterNIC. The InterNIC assigns only network IDs. The assignment of host IDs is up to the system administrator.

Figure :- Ranges for different classes of IP addresses.

Class Range

A 0.0.0.0 to 127.255.255.255

B 128.0.0.0 to 191.255.255.255

C 192.0.0.0 to 223.255.255.255

D 224.0.0.0 to 239.255.255.255

E 240.0.0.0 to 247.255.255.255

Page 60: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

60

IP Address Structure - Class-full

Network address Host address

Address format32 bits

Class Anetwork=8 bits

Class Bnetwork=16 bits

Class Cnetwork=24 bits

Class D (multicast)

Class E(reserved)

0

1 0

1 1 0

1 1 1 0

1 1 1 1

Page 61: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

61

Conttd…Conttd…

There are three types of IP addresses:

1. Unicast (Destined for a single host), 2. Broadcast (Destined for all hosts on a given

network), 3. Multicast (Destined for a set of hosts that belong

to a multicast group)

Page 62: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

62

Domain Name SystemDomain Name System

Although the network interfaces on a host, and therefore the host itself, are known by IP addresses, humans work best using the name of a host. In the TCP/IP world the Domain Name System (DNS) is a distributed database that provides the mapping between IP addresses and hostnames.

For now we must be aware that any application can call a standard library function to look up the IP address (or addresses) corresponding to a given hostname. Similarly a function is provided to do the reverse lookup-given an IP address, look up the corresponding hostname.

Page 63: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

63

Encapsulation Encapsulation When an application sends data using TCP, the data

is sent down the protocol stack, through each layer, until it is sent as a stream of bits across the network. Each layer adds information to the data by pretending headers (and sometimes adding trailer information) to the data that it receives.

The unit of data that TCP sends to IP is called a TCP segment. The unit of data that IP sends to the network interface is called an IP datagram. The stream of bits that flows across the Ethernet is called a frame.

A physical property of an Ethernet frame is that the size of its data must be between 46 and 1500 bytes.

Page 64: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

64

Conttd…Conttd…

Page 65: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

65

Conttd…Conttd…

Page 66: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

66

Client Server ModelClient Server Model Most networking applications are written assuming one side is

the client and the other the server. The purpose of the application is for the server to provide some defined service for clients. We can categorize servers into two classes:

1. Iterative 2. Concurrent

An iterative server iterates through the following steps.

1. I1. Wait for a client request to arrive.2. I2. Process the client request.3. I3. Send the response back to the client that sent the request.4. I4. Go back to step I1.

The problem with an iterative server is when step I2 takes a while. During this time no other clients are serviced.

Page 67: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

67

Conttd…Conttd… A concurrent server, on the other hand, performs the

following steps.1. Cl. Wait for a client request to arrive.2. C2. Start a new server to handle this client's request. This may

involve creating a new process, task, or thread, depending on what the underlying operating system supports. How this step is performed depends on the operating system. This new server handles this client's entire request. When complete, this new server terminates.

3. C3. Go back to step Cl.The advantage of a concurrent

server is that the server just spawns other servers to handle the client requests. Each client has, in essence, its own server. Assuming the operating system allows multiprogramming, multiple clients are serviced concurrently.

Page 68: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

68

Port NumbersPort Numbers

Servers are normally known by their well-known port number. For example, every TCP/IP implementation that provides an FTP server provides that service on TCP port 21. Every Telnet server is on TCP port 23. Every implementation of TFTP (the Trivial File Transfer Protocol) is on UDP port 69.

Those services that can be provided by any implementation of TCP/IP have well-known port numbers between 1 and 1023. The well-known ports are managed by the Internet Assigned Numbers Authority (IANA).

Page 69: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

69

LINK LAYERLINK LAYER

Page 70: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

70

Introduction Introduction The purpose of the link layer in the TCP/IP protocol

suite is to send and receive 1. IP datagrams for the IP module2. ARP requests and replies for the ARP module3. RARP requests and replies for the RARP module

TCP/IP supports many different link layers, depending on the type of networking hardware being used:

EthernetToken ringFDDI (Fiber Distributed Data

Interface) RS-232 serial lines

Page 71: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

71

Ethernet & IEEE 802 EncapsulationEthernet & IEEE 802 Encapsulation Ethernet is a standard published in 1982 by DEC(Digital

Equipment Corporation) & XEROX Corp.. It is a LAN with TCP/IP using access method CSMA?CD. It uses 48-bit MAC Address. Operating speed is from 10Mbps. IEEE committee published a slightly different standards.

802.3 covers entire set of CSMA/CD networks.802.3 covers entire set of Token Bus networks.802.3 covers entire set of Token Ring networks.

802.2 standard is common to all & define logical link control. Combination of 802.2 & 802.3 defines a new standard that is

different from true Ethernet by DEC & XEROX

Page 72: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

72

IEEE 802.2/802.3 Encapsulation(RFC 1042)IEEE 802.2/802.3 Encapsulation(RFC 1042)

Page 73: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

73

SLIP- Serial Line IPSLIP- Serial Line IP SLIP stands for Serial Line IP. It is a simple form of

encapsulation for IP datagrams on serial lines. SLIP has become popular for connecting home systems to the Internet, through the ubiquitous RS-232 serial port found on almost every computer and high-speed modems. The following rules specify the framing used by SLIP.

The IP datagram is terminated by the special character called END (0xc0).To prevent any line noise before this datagram from being interpreted as part of this datagram, most implementations transmit an END character at the beginning of the datagram too. (If there was some line noise, this END terminates that erroneous datagram, allowing the current datagram to be transmitted. That erroneous datagram will be thrown away by a higher layer when its contents are detected to be garbage.)

Page 74: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

74

Conttd..Conttd..

If a byte of the IP datagram equals the END character, the 2-byte sequence 0xdb, 0xdc is transmitted instead. This special character, 0xdb, is called the SLIP ESC character, but its value is different from the ASCII ESC character (0xib).

If a byte of the IP datagram equals the SLIP ESC character, the 2-byte sequence 0xdb, 0xdd is transmitted instead.

Page 75: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

75

Conttd..Conttd..

Figure :-SLIP encapsulation

Page 76: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

76

Conttd…Conttd… SLIP is a simple framing method. It has some

deficiencies that are worth noting.1.Each end must know the other's IP address. There is

no method for one end to inform the other of its IP address.

2.There is no type field (similar to the frame type field in Ethernet frames). If a serial line is used for SLIP, it can't be used for some other protocol at the same time.

3.There is no checksum added by SLIP (similar to the CRC field in Ethernet frames). If a noisy phone line corrupts a datagram being transferred by SLIP, it's up to the higher layers to detect this.

Page 77: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

77

Compressed SLIPCompressed SLIP

SLIP lines are often slow (19200 bits/sec or below) and frequently used for interactive traffic (such as Telnet and Rlogin, both of which use TCP), there tend to be many small TCP packets exchanged across a SLIP line. To carry I byte of data requires a 20-byte IP header and a 20-byte TCP header, an overhead of 40 bytes.

Recognizing this performance drawback, a newer version of SLIP, called CSLIP (for compressed SLIP). CSLIP normally reduces the 40-byte header to 3 or 5 bytes. It maintains the state of up to 16 TCP connections on each end of the CSLIP link and knows that some of the fields in the two headers for a given connection normally don't change. Of the fields that do change, most change by a small positive amount. These smaller headers greatly improve the interactive response time.

Page 78: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

78

PPP: Point-to-PointPPP: Point-to-Point

PPP, the Point-to-Point Protocol, corrects all the deficiencies in SLIP. PPP consists of three components.

1. A way to encapsulate IP datagram on a serial link. PPP supports either an asynchronous link with 8 bits of data and no parity (i.e., the ubiquitous serial interface found on most computers) or bit-oriented synchronous links.

2. A link control protocol (LCP) to establish, configure, and test the data-link connection. This allows each end to negotiate various options.

3. A family of network control protocols (NCPs) specific to different network layer protocols, currently exist for IP, the OSI network layer, DECnet, and AppleTalk. The IP NCP, for example, allows each end to specify if it can perform header compression, similar to CSLIP.

Page 79: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

79

Conttd…Conttd…

Figure :- Format of PPP frames.Figure :- Format of PPP frames.

Page 80: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

80

Review of LectureReview of Lecture

We have learned today the following topicsWe have learned today the following topics

Introduction Computer Networks OSI & TCP/IP Reference Model Layering, TCP/IP, Internet Addresses, DNS, Client

Server Model, Port Numbers. Link Layer Ethernet & IEEE 802( SLIP, PPP).

Page 81: 1 COMPUTER NETWORKS-1 (BTCS-403) By Baljinder Singh Assistant Professor (I.T) Beant College of Engg. & Technology, Gurdaspur

81

THANKSTHANKS