+ All Categories
Home > Documents > TCP/ IP BCS-061

TCP/ IP BCS-061

Date post: 31-Dec-2015
Category:
Upload: jacob-mccormick
View: 19 times
Download: 2 times
Share this document with a friend
Description:
TCP/ IP BCS-061. SESSION -1. 2. Presentation Title | July 27, 2010 | . Introduction. - PowerPoint PPT Presentation
130
An ISO 9001:2000 Certified Organization TCP/ IP BCS-061
Transcript

An ISO 9001:2000 Certified Organization

TCP/ IP BCS-061

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

2

SESSION -1

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

3

Introduction

• Transmission Control Protocol (TCP)/Internet Protocol (IP) is a set of protocols developed to allow computers of all sizes from different vendors, running different operating systems, to communicate or to share resources across a network.

• A packet switching network research project was started by the USA Government in late 1960s, became the most widely used form of computer networking. This project centered around ARPANET.

• ARPANET is the best known TCP/IP network.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

4

• TCP/IP is the principal UNIX networking protocol. This was designed to provide a

reliable end-to-end byte stream over an unreliable inter network.

• TCP is a connection_oriented protocol while IP is a connection less protocol.

• TCP supplies logic to give a reliable connection-oriented protocol above IP.

• It provides a virtual-circuit that two processes can use to communicate.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

5

• 1P (Internet Protocol) provides a connection less and unreliable delivery system.

• It considers each data gram independently.

• UDP (user data gram protocol) is a connectionless and unreliable protocol.

• It adds a checksum to IP for the contents of the data gram and pass members.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

6

Origin of TCP / IP : HOW?

1. Communication(i) Early Methods (drumbeats / smoke / fire /pigeon

/ flashing lights)(ii) Postal Services (East India company in Metro

cities introduced postal system in 1766)(iii) Telegraph (first electronic medium for global

communication: which send / receive electrical signals over long distance wires)

(iv) Telephone(v) Computers and Internet

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

7

• ARPANET first electronic-mail network• National science foundation (NSF) helped

connect universities and non-military research sites to the ARPANET

• Router : It is used to connect physically distinct networks by NIC (Network Interface Card)

ROUTERNETWORK X -------- NETWORK Y• A router is a device with more than one NICs.

Router can connect incompatible networks as it has the necessary hardware and protocols (TCP / IP)

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

8

TCP/IP LAYERING

Transmission Control Protocol (TCP) :

Provides a reliable data stream service to

network application programs.

* The various gateways uses TCP to communicate with mail programs on other TCP/IP nodes.

* Third-party applications written with the

TCP/UDP programming interface can also

use TCP.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

9

User-Datagram Protocol (UDP):

• Provides an unreliable datagram service to network applications.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

10

• TCP /IP Protocol suit at software level defines a packet size, routing algorithms, error control, flow control methods universally

• Since it is difficult to deal with complex set of rules, and functions required for computer networking , these rules and functions are divided with logical groups called layers

• Each layer can be implemented interdependently with an interface to other layer

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

11

ARPANET (Advanced Research Projects Agency)

• ARPA in the US Department of Defence (DoD) wanted to find a way to connect computers so that their researchers could share their findings.

• 1n 1967, , ARPA proposed its idea for ARPANET, a small network for connecting computers

• ARPANET aims to connect different networks together.

• Gateway as an intermediate hardware to transfer data from one network to another.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

12

• In 1977, the communication between networks was made possible , internet consisting of three different networks-

• 1. ARPANET• 2. Packet radio• 3. Packet satellite

1n 1978 ARPA signed a contract with Berkley under which TCP / IP software was incorporated in the operating system itself.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

13

Time Line

• In 1983 original ARPANET protocols were abolished and TCP/IP was made standard for internet.

• 1969 4-node ARPA established• 1972 internetting project begins• 1973 development of TCP/IP suite begins• 1977 an internet tested using TCP/IP• 1978 Unix distributed to universities• 1983 TCP/IP became the official protocol for

ARPANET

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

14

TCP / IP Layers & Protocols

• The TCP/IP model is made up of 4-Layers1. Interface layer2. Network or Internet layer3. Transport layer4. Application layer Interface layer includes the services of data

link layer and physical layer of OSI model. In OSI model each layer takes the services of

the lower layer. Whereas the layers of TCP/IP protocol contain independent protocols

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

15

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

16

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

17

Interface layer:

• Interface layer or (Physical + Data Link Layer)

• The physical layer deals with the hardware level like transmission media , connections and the voltage for digital signals.

• The data link layer deals with media access and control strategies , frame format etc.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

18

Network Layer :

• At this layer, TCP/IP supports internetworking protocol.

• IP is a host-to-host protocol.• This layer is responsible for the format of

data gram as defined by IP and routing a datagram or packet to the next hop.

• This layer is not responsible for the accurate and timely delivery of datagrams to the destination in proper sequence.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

19

• IP allows raw transmission functions allowing user to add functionalities necessary for given application .

• Ensuring maximum efficiency • TCP/IP supports 4-other protocols – in this

layer-:1. ARP2. RARP3. ICMP4. IGMP

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

20

ARP (Address Resoulution Protocol)

• ARP is used to find the physical address of a machine when its IP address is known.

• RARP (Reverse address resolution

protocol )

It is used to find the IP address of a machine when its physical address is known

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

21

• ICMP (Internet Control Message protocol) In case of failures ICMP is used to

notifications to the sender about packet problems .

It sends error and query messagesIGMP (Internet Group Message protocol) It is used for multicasting, which is

transmission of a single message to a group of recipients

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

22

Various Protocols at different Layers in TCPIP protocol

• In the TCPIIP architecture, application protocols such as SMTP and FTP perform

session and presentation layer functions.

* A distinct session layer or presentation layer

does not exist.• The protocols in each layer provide services to

the protocols in the layer above it. For

example, TCP relies on IP to move TCP messages through the network..

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

23

• In order for your computer to connect to the Internet, it must be installed with a correctly configured TCPIP stack.

• A TCP/IP stack is the software that provides an implementation of the TCPIP suite of protocols.

This software works in the middle, between the TCP/lP applications running on your computer and your computer's network hardware and associated drivers.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

24

• Some TCPIP applications come with their own built-in TCP stack

• On Macintosh computers, the standard TCPIIP stack is called Open Transport.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

25

TCP/IP Fundamentals

• TCP ( "transmission control protocol") is responsible for breaking up the message into datagram, reassembling them at the other end, resending anything that gets lost, and putting things back in the right order.

• IP (the "internet protocol") is responsible for routing individual datagrams.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

26

Demultiplexing

• To transfer any datagram TCP keeps track of multiple connections to a given system.

• Clearly it is not enough to get a datagram to the right destination. TCP has to know

While connecting this datagram is part of. This task is referred to as Demultiplexing"

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

27

What is the role of Header in TCP/IP

transmission? The information needed to do this demultiplexing

is contained in a series of "headers".

A header is• simply a few extra octets tacked onto the

beginning of a datagram by some protocol in

order to keep track of it. It's lot like putting a letter into an envelope and putting an address on the outside of the envelope

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

28

• TCP puts a header at the front of each datagram.

• This header actually contains at least

20 octets, but the most important ones are a source and destination "port number" and a

"sequence number

The port numbers are used to keep track of different conversations.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

29

Parameters of Datagram:

• Source Port ( Destination Port

Sequence Number

• Acknowledgement Number

• If we abbreviate the TCP header as "T", the whole file now looks like this:

• Data

• Offset

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

30

The IP Level

TCP sends each of these datagram to IP. Of course it has to tell IP the Internet address

of the computer at the other end. Note that this is all IP is concerned about.

It doesn't care about what is in the datagram, or even in the TCP header. IP's job is simply to find

• Checksum• Urgent Pointer• your data ... next 500 octets• Note that TCP and IP have separate checksums

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

31

SESSION -2

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

32

Ethernet

Ethernet designers allocated 48 bits for the Ethernet address.

Ethernet is a "broadcast medium". That is, it is in effect like an old party line telephone.

When you send a packet out on the Ethernet, every machine on the network sees the packet. So something is needed to ensure that the right machine gets it.

This involves the Ethernet header.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

33

Every Ethernet packet has a 14-octet header that includes the source and destination Ethernet address, and a type code

There is no connection between the Ethernet address and the Internet address.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

34

How Ethernet controller works?

• The Ethernet controller computes a

checksum of the entire packet. When the other end receives the packet, it recomputes the checksum, and throws the packet away if the answer disagrees with the original.

• The checksum is put on the end of the packet, not in the header. The final result is that your message looks like this:

• Ethernet destination address (first 32 bits) ' • Type code

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

35

• IP header, then TCP header, then your data

• Ethernet dest (last 16'bits)

• end of your data

• Ethernet source (first 16 bits)

• Ethernet Checksum

• Ethernet source address (last 32 bits)

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

36

DOMAIN NAME SYSTEM (DNS)

• For human beings wanting to access Internet resources, names are much easier to remember than IP addresses;

• The Domain Name System (DNS) was created to provide a mapping between names for Internet resources and their associated IP addresses;

• Characteristics of DNS: The fallowing are the characteristics of DNS

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

37

Hierarchical naming scheme

• Delegation of authority for names

• Distributed databases of name to IP address (and IP to name) mappings

• Each name authority must operate at least two DNS database servers (name

• servers) for their authorized domain

• Every TCP/IP implementation has a software routine called the name

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

38

CLIENT SERVER MODEL

• Most of the TCP/IP applications that you will use across the Internet operate on a

client-server model. In this model, the actual machines and

applications that you use to get information (World-Wide-Web browsers, Gopher browsers, electronic mail programs, News reading programs, IRC chat programs, etc.) are the clients.

The machines and programs that provide the information are the servers.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

39

Clients and Servers

• a specific machine can be both a

client and a server. For example, if you are using your PC to browse the World Wide

Web, your PC is a client.

When a colleague of yours connects to that same machine to copy a file to his machine, your machine is a server.m

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

40

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

41

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

42

Client server computing

• An application that initiates peer-to-peer communication is called a client.

• Most client Software consists of conventional application programs.

• Each time a client application executes, it contacts a server, sends a request and awaits a response. When the response arrives client continues processing

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

43

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

44

Server must contain code that handles issue of :

Authentication : verifying the identity. Of client;

Authorization : determining whether a given client is permitted to access the. server supplies;Data Security : guaranteeing that data is not unintentionally revealed or compromisedProtection : guarantees the network application cannot abuse technically.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

45

Internet addresses

• TCP supplies logic to give a reliable connection-oriented protocol above IP.

• It provides virtual circuit that two processes can use to communicate.

• In order to use a service one must be able to find it. The Internet uses an address scheme for machines so that they can be located.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

46

The address is a 32 bit integer which gives the:

• IP address This encodes a network ID and more addressing. The network ID falls into

various classes according to the size of the network address.

Network address• Class A use 8 bits for the network address with

24 bits left over for other addressing.• Class B uses 16 bit network addressing.• Class C uses 24 bit network addressing and

class D uses all 32.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

47

• Host address : 8 bits are finally used for host addresses within subnet (if it exists-typically for class B network addressing).

• This places a limit of 256 machines that can be on the subnet.

• Total address : The 32 bit address is usually written as 4 integers separated by dots.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

48

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

49

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

50

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

51

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

52

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

53

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

54

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

55

TCP header structure :

• 32 bits• Source port I Destination port• Sequence number• Acknowledgement number• Offset Reserved• Checksum • Urgent pointer• Option + Padding• Data

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

56

TRANSMISSIONCONTROL PROTOCOL (TCP)

• TCP provides reliable, end-to-end data transmission with flow control

• Examples of TCP applications include Telnet, FTP, WWW, POP, IMAP, etc.

• Basic features of TCP transmission: • Streamed Data: Data from sender to receiver

organized as a stream of bits • divided into 8-bit bytes (data streams have 110

TCP imposed structure)• Byte Stream

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

57

INTERNET ADDRESSING TCPIIP

• IP Address Component Like other network layer protocols, the 1P addressing scheme is integral to the process of routing 1P data through an internetwork.

• Each host on a TCPIIP network is assigned a unique 32-bit logical address.

• The 1P address is divided into two main parts; the Network Number and the Host Number.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

58

• The network number identifies the network and must be assigned by the internet

• Network Information center (InterNlC) if the network is to be part of the Internet.

• The host number identifies a host in the network and is assigned by the local network administrator

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

59

IP Address Format

• The 32-bit IP address is grouped 8 bits at a time, each group of 8 bits is an octet.

• Each of the four octets are separated by a dot, and represented in decimal format, Each bit in an octet has a binary weight (128, 64, 32, 16, 8,4, 2, 1).

• The minimum value for an octet is 0 (all bits set to O), and the maximum value for an octet is 255 (all bits set to 1).

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

60

IP Address Classes :

• IP addressing supports three different commercial address classes :

1. Class A

2. Class B

3. Class C.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

61

class A address :

• In a class A address, the first octet is the network portion, so the class A address of,

10.1.25.1, has a major network address of 10. Octets 2,3, and 4 (the next 24 bits) are for the hosts.

Class A addresses are used for networks that have more than 65,536 hosts (actually, up to 16,581,375 hosts!).

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

62

class B address:

• In a class B address, the first two octets are the network portion, so the class B address

• of, 1 72.16.122.204, has a major network address of 172,16. Octets 3 and 4 (the next 16 bits) are for the hosts, Class B addresses are used for networks that have between 256

and 65,536 hosts.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

63

Class C address :

• In a class C address, the first three octets are the network portion.

• The class C address of, 193.1 8.9.45, has a major network address of 193.1 8.9. Octet 4 (the last 8 bits) is for hosts. Class C addresses are used for network with less than 254 hosts.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

64

IP HEADER

• The Internet Protocol (IP), defined by IETF (Internet Engineering Task Force) RFC791,

• is the routing layer datagram service of the TCP/IP suite

• The IP frame header contains routing information and control information associated with datagram delivery.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

65

• Physical network: A collection of computers, communication via wiring, etc. that communicate directly with one another (e.g., Ethernet, Token Ring).

Host : A computer, connected to a physical network, that exchanges information with another computer via TCPIIP.

• Gateway: A computer that interconnects two or more physical networks and that routes TCPIIP information among those networks (accurately referred to as a router).

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

66

Internet addresses

• The Internet uses an address scheme for machines so that they can be located. The address is a 32 bit integer which gives the

IP address. This encodes a network ID and more

addressing. The network ID falls into various classes according to the size of the network address.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

67

Network address

• Class A use 8 bits for the network address with 24 bits left over for other addressing.

• Class B uses .16 bits network addressing.

• Class C uses 24 bits network addressing

• Class D uses all 32 bits.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

68

• Host address 8 bits are finally used for host addresses

within subnet (if it exists-typically for class B

network addressing). This places a limit of 256 machines that can be on the subnet.

Total address• The 32 bit address is usually written as 4

integers separated by dots. ].

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

69

SESSION - 3

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

70

What is a Socket?

• Socket: An interface between an application process and transport layer

• The application process can send/receive messages to/from another application process (local or remote) via a socket

• In Unix, a socket is a file descriptor . an integer associated with an open file

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

71

Types of Sockets:

• Internet Sockets

• unix sockets,

• X.25 sockets etc

• Internet sockets characterized by IP Address (4 bytes) and port number (2 bytes) i.e

• Sockets = IP Address + Port number

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

72

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

73

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

74

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

75

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

76

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

77

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

78

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

79

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

80

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

81

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

82

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

83

Socket Description

• Types of Internet Sockets

• _ Stream Sockets (SOCK_STREAM)• _ Connection oriented• _ Rely on TCP to provide reliable two-way connected• communication• _ Datagram Sockets (SOCK_DGRAM)• _ Rely on UDP• _ Connection is unreliable

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

84

Conversions:

• _ htons() - Host to Network Short

• _ htonl() - Host to Network Long

• _ ntohs() - Network to Host Short

• _ ntohl() - Network to Host Long

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

85

Connection Oriented Protocol

• socket()• connect()• bind()• accept()• send()• recv()• listen()• socket()• send()• recv()

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

86

Socket structures

• _struct sockaddr: Holds socket address information for

• many types of sockets

• _ struct sockaddr_in: A parallel structure that makes it

• easy to reference elements of the socket address

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

87

• struct sockaddr {• unsigned short sa_family; //address family AF_xxx• unsigned short sa_data[14]; //14 bytes of protocol addr• }• struct sockaddr_in {• short int sin_family; // set to AF_INET• unsigned short int sin_port; // Port number• struct in_addr sin_addr; // Internet address• unsigned char sin_zero[8]; //set to all zeros• }

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

88

]Transmission Control Protocol (TCP) and User

Datagram Protocol (UDP) • TCP/IP is the most important internetworking

protocol suite in the world; it is the basis for the Internet , and the “language” spoken by the vast majority of the world's networked computers

• TCP/IP includes a large set of protocols that operate at the network layer and above. The suite as a whole is anchored at layer three by the Internet Protocol (IP), which many people consider the single most important protocol in the world of networking.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

89

bind() - what port am I on?

• _ Used to associate a socket with a port on the local machine

• _ The port number is used by the kernel to match an incoming

• packet to a process• _ int bind(int sockfd, struct sockaddr *my_addr, int

addrlen)• _ sockfd is the socket descriptor returned by socket()• _ my_addr is pointer to struct sockaddr that contains

information

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

90

• about your IP address and port

• _ addrlen is set to sizeof(struct sockaddr)

• _ returns -1 on error

• _ my_addr.sin_port = 0; //choose an unused port at random

• _ my_addr.sin_addr.s_addr = INADDR_ANY; //use my IP addr

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

91

connect() - Hello!

• _ Connects to a remote host

• _ int connect(int sockfd, struct sockaddr *serv_addr, int

• addrlen)

• _ sockfd is the socket descriptor returned by socket()

• _ serv_addr is pointer to struct sockaddr that contains

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

92

• information on destination IP address and port

• _ addrlen is set to sizeof(struct sockaddr)

• _ returns -1 on error

• _ At times, you don't have to bind() when you are using

• connect()

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

93

listen() - Call me please!

• _ Waits for incoming connections• _ int listen(int sockfd, int backlog);• _ sockfd is the socket file descriptor returned by

socket()• _ backlog is the number of connections allowed

on the• incoming queue• _ listen() returns -1 on error• _ Need to call bind() before you can listen()

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

94

accept() - Thank you for calling !

• _ accept() gets the pending connection on the port

• you are listen()ing on• _ int accept(int sockfd, void *addr, int *addrlen);• _ sockfd is the listening socket descriptor• _ information about incoming connection is

stored in• addr which is a pointer to a local struct

sockaddr_in

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

95

• _ addrlen is set to sizeof(struct sockaddr_in)

• _ accept returns a new socket file descriptor to use for

• this accepted connection and -1 on error

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

96

send() and recv() - Let's talk!

• _ The two functions are for communicating over stream

• sockets or connected datagram sockets.• _ int send(int sockfd, const void *msg, int len, int

flags);• _ sockfd is the socket descriptor you want to

send data to• (returned by socket() or got with accept())• _ msg is a pointer to the data you want to send

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

97

• _ len is the length of that data in bytes

• _ set flags to 0 for now

• _ sent() returns the number of bytes actually sent (may be less

• than the number you told it to send) or -1 on error

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

98

Multiple Recipients:

• There are different ways of transmitting a message over a network , one way in which a data is sent from a single source to a specified destination is known as unicasting that is just one sender and one receiver is known as unicasting

• In multicasting data is sent to a specified group of destinations

• In broadcasting data is sent to all connected destinations

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

99

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

100

Connectionless Protocol

• socket()

• bind()

• bind()

• recvfrom()

• sendto()

• socket()

• recvfrom()

• sendto()

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

101

How RFCs works?

The standard for TCP/IP are published in a series of documents called RFC (Request for comments )RFCs describe the internal working of the internet.TCP/IP stadards are always published as RFCsRFCs provide informational , experimental or historical information only

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

102

TCP/IP internetwork layer:

1. Internet protocol

2. Internet control message protocol (ICMP)

3. Address resolution protocol (ARP)

4. Reverse address resolution protocol (RARP)

5. Bootstrap protocol

6. Dynamic host configuration protocol (DHCP)

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

103

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

104

Important terms:Node : any device including routers and hosts, that runs an implementation of IP

Router : A node that can forward IP packets on an IPv6 network, a router advertises its presence and host configuration information

LAN segment : a portion of a subnet consisting of a single medium that is bounded by bridges or layer 2 switches.

Subnet / network segment / link : one or more segments that are bounded by routers and use the same IP address prefix

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

105

Host : A node that cannot forward IP packets to itself . A host is the source and destination of IP trafficNetwork or Internework: two or more subnets connected by routers. Neighbor : a node connected to the same subnet as another node.Interface : the representation of a physical or logical attachment of a node to a subnet.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

106

What is FDDI?

FDDI (Fiber Distributed Data interface ) defines a family of standards for 100 mbps fiber optic LANs that provides the physical layer and media access control sublayer of the data link layer as defined by the ISO / OSI model

It defines the encapsulation of IP datagram and ARP requests and relies in FDDI frames

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

107

SLIP (Serial Line IP):

• The TCP/IP protocol family runs over a variety of network media : IEEE 802.3 and 802.5 LANs, X.25 lines, satellite links and serial lines.

• SLIP is a standard used for point-to-point serial lines connections running TCP/IP.

• SLIP is not an internet standard• SLIP is a Packet running protocol• It defines sequence of characters that frame IP

packets on a serial line.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

108

PPP (Point-to-Point):

• PPP is a network-specific standard protocol and is described in RFC 1661 and RFC 1662.

• A method for encapsulating datagrams over serial links

• A link control protocol (LCP) for establishing, configuring and testing the data link connection

• A family of Network Control protocols (NCPs) for establishing and configuring differnet network layer protocols.

• PPP is designed to allow the simultaneous use of multiple network layer protocolsm

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

109

ISDN (Integrated Digital Network):

• ISDN Basic Rate Interface usually supports two B-Channel for control information.

• B-channel can be used for voice or data.• The ISDN primary rate interface can support

many concurrent B-channel links and one 64 Kbps D-channel

• ISDN D-channel can also be used for sending PPP packets.

• PPP treat ISDN channels as bit or octet oriented synchronous links.

• These links can be full duplex

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

110

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

111

Important Expansions

MTU – Maximum transfer unit

SDLC- synchronous data link control

IPCP- IP control protocol

MRU-Maximum Receive unit

FDDI- Fiber Distributed Data Interface

SNAP-Subnetwork access Protocol

LCP-Link control Protocol

PRI-Primary Rate Interface

DTE- Data Terminal Equipment

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

112

• PDU-Protocol Data Units

• CUD- Call user Data

• NLPID Network layer protocol identifier

• DLCI-Data Link Connection identifier

• PVC-Permanent Virtual circuits

• SPE – Synchronous payload envelope

• SVCs – switched virtual connections

• SONET – Synchronous Optical Network

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

113

X.25 Networks :

• IP over X.25 networks, is documented by RFC 1356.

• X.25 virtual circuits are opened on demand when datagrams arrive at the network interface for transmission

• PDU(protocol data units) are sent as X.25 complete packet sequences

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

114

What is Frame Relay?

• The frame relay network provides a number of virtual circuits that form the basis for connections between stations attached to the same frame relay network.

• The resulting set of interconnected devices forms a private frame relay group, which can be either fully interconnected with a complete mesh of virtual circuit or only partially interconnected.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

115

Fragmentation :

• When an IP datagram travels from one host to another, it can pass through different physical networks.

• Each physical network has a maximum frame size, this is called the maximum transmission unit (MTU)

• It limits the length of a datagram that can be placed in one physical frame.

• IP implements a process to fragment datagram within the maximum size.

• The receiving host reassembles the original datagram

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

116

• Exchange of Information

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

117

IMAP4 :

• The internet message access protocol version 4 is an electronic messaging protocol with both client and server functions.

• IMAP4 servers store message for multiple users to be retrieved upon client requests

• It allows clients to have multiple remote mailboxes from which messages can be retrieved

• IMAP4 always keeps messages on the server and replicates copies to the clients

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

118

What is MIB ?

• The mgmt. Information base defines a set of objects which can be monitored or managed using an SNMP implementation

• The current MIB MIB-II is defined in RFC 1213 and replaces the MIB-I definition outlined in RFC 1156.

• MIB-II defines the groups of information which should be made available in any SNMP implementation in a TCP/IP based network

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

119

What is OSPF ?

• The open shortest path first protocol is an example of an interior gateway protocol.

• It was developed as a non-proprietary routing alternative to address the limitations of RIP.

• OSPF packets are transmitted in IP datagrams• All OSPF packets share the common header• OSP Hello protocol discovers and maintains

relationship with neighboring routers.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

120

EIGRP (Enhanced Interior Gateway Routing Protocol)

• EIGRP is categorized as a hybrid routing protocol• EIGRP uses metrics to determine network paths• Topology updates in an EIGRP environment are event driven• EIGRP has the potential for improved scalability and faster

convergence over standard distance vector algorithm• EIGRP support complex, highly redundant networks• EIGRP supports the ability to summarize routing

announcements• EIGRP can provide network layer routing for AppleTalk IPX

and IP network.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

121

TFTP (Trivial file transfer protocol):

• TFTP file transfer is a disk-to-disk data transfer.• Some diskless devices use TFTP to download

their firmware at boot time.• TFTP is implemented on top of UDP• TFTP lacks most of the features of FTP the only

thing it can do is read / write a file from / to a server.

• TFTP client initially sends read / write request via port 69 then the server and the client determines the port that they will use for the connection.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

122

FTP (File Transfer Protocol):

• This protocol transfers data between client and server in either direction

• It is necessary to have both host up and running TCP/IP to establish a file transfer.

• FTP uses TCP as a transport protocol to provide reliable end-to-end connections.

• It also list files available for transfer• It also defines the transfer mode• FTP uses 4-commands – 1. OPEN 3.PASS 2. USER 4. SITE

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

123

NFS(Network File system):

1. The SUN microsystems network file system protocol enables machines to share file systems across a network.

2. The NFS protocol is designed to be machine-Operating system and transport protocol-independent.

3. This is achieved through implementation on top of Remote procedure call(RPC).

4. RPC establishes machine independence by using the external data representation convention

5. NFS allows authorized users to access files located on remote system

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

124

Coordination and

Synchronization

Of

Signals

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

125

Security implementation in Network

• The following protocols and systems are commonly used to provide various degree of security services in a computer network

1. IP filtering2. Network Address Translation (NAT)3. SOCKS (SSL ,TLS)4. Secure Shell (SSH)5. Firewalls

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

126

Packet Filtering Router

• The following information can be extracted from the packet header :

1. Source IP address2. Destination IP address3. TCP/UDP source port4. TCP/UDP destination port5. ICMP message type6. Encapsulation protocol informaion

(TCP,UDP,ICMP or IP tunnel)

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

127

Packets

Of

information

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

128

Why we use Firewall in networking?

• A Firewall consists of one or more software elements that run on one or more hosts.

• The hosts may be general purpose computer system or specialized such as routers

• Example of Firewalls :

1. Packet-filtering firewall

2. Dual-homed gateway firewall

3. Screened host firewall

4. Screened subnet firewall

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

129

HTTP(Hypertext transfer protocol)

• HTTP is a protocol designed to allow the transfer of HTML documents.

• HTML is a tag language used to create hypertext documents

• Hypertext documents include links to other documents that contain additional information

• HTTP is based on request-response activity• HTTP is a stateless protocol as it doesn’t keep

track of the connections• HTTP communication takes place over TCP

connections, the default port I TCP 80.

© Copyright PCTI Group 2009Presentation Title | July 27, 2010 | <document classification>

130

• A cookie is a set of information that is exchanged between a client web browser and a web server during an HTTP transaction

• The maximum size of a cookie 4MB• All these pieces of information or cookies are

then stored on one single file and placed in the directory of the web browser

• If cookies are disabled that file is automatically deleted

• A cookie can be retrieved and checked by the server at any subsequent connection.


Recommended