Você está na página 1de 79

Networking Basics

&
OSI Reference Model
Networking: An Overview

A network is a group of interconnected


systems which share services and interact with
each other by means of a shared
communication link.

These systems can be located anywhere.

Network is often classified according to its


geographical size.
Benefits of networking
Goal of having networking environment is to provide
services and to reduce the equipment costs. The
primary reasons for networking PC's are as follows:

ØSharing printers and other devices


ØProviding Distributed Computing.
ØSharing Files
ØCentralised administration of resources
ØSecurity of Resources.
ØPersonal communications (like e-mail, chat,
audio/video conferencing)
ØWorld Wide Web ... and many other uses
Networking Basics
Networking Basics
• Network consist many components:
– Hardware
• Transmission Facilities
• Access Devices
• Devices that repeat transmitted signals
– Software
• Protocol that define and regulate the way two or
more device communicate.
• Drivers, that guide the functionality of NIC
• Communication Software.
Networking Basics: Hardware
• Transmission Facilities
– Are the media used to transport network’s signals to their
destination.
• Coaxial Cable, Twisted Pair, Fiber- Optic
• Access Devices
– Is known as Network Interface Card (NIC), and is responsible for
• Properly formatting data so that it can be accepted in the network
• Placing data on the network
• Accepting transmitted data that’s addressed to it.
• Repeaters/Hubs
– Accepts transmitted signals, amplify it and puts them back on the
network
Network Basics : Software
• Protocol
– Are standards that allow computer to communicate.
– Define how computer identify one another on a network
– How information be processed once it reach its final
destination.
– Define procedure for handling lost or damaged packets.
• Device Drivers
– Is a hardware level program that control NIC
– NIC, provide an interface for its host’ operating system
• Communication Software
– That enable the users to communicate and share resources
• Windows Explorer, WWW, Telnet, FTP
Networking Basics: LAN
• Hardware and Software are to be integrated
to make a LAN
• Repeater-less LAN

• Hub Based LAN


Networking Basics : LAN
Networking Basics : LAN
•Local Area Networks use frames to encapsulate data
in a structure that contains all the necessary
information required to ship it to its requested
destination.

•A "frame" is a block of data transmitted on a


network. The size and structure of the frame is
determined by the hardware layer protocol that the
network uses.

Eg Ethernet, Token Ring, and so on.


• The mechanics of frame forwarding is called a protocol.

• Networks are, essentially, a frame-forwarding


infrastructure, and have the same need for
standardization of frames. Standardization ensures that
different network components made by different
manufacturers can interoperate.

•The body that has been responsible for many of the


existing standards that support today's high-
performance networks is the Institute of Electrical and
Electronics Engineers (IEEE).
NEED FOR A STANDARD IN NETWORKING
The need for a standard in network arises from the fact that there
are:

u Different types of connection media such as Telephone


lines,optical fibers, cables, radios, etc.

u Different types of machines and operating systems

u Different network applications

Hence the need for a STANDARD in communication technology:


THE ISO STANDARD MODEL FOR
COMMUNICATIONS: OSI
• ISO (the International Organization for Standardisation)
has developed a standard model for communications, called
the OSI (Open Systems Interconnection) Model
• Open System : It can communicate with any other
system that follows the specified standards, formats,
and semantics.
• An Open system is one for which the architecture is not a
secrete and is readily available to others.
• Standard-based solution guarantee users the capability to
invoke and use any of the preceding services without paying
attention to the underlying technology supporting them.
OSI model consists of seven layers
LAYERING OF OSI Model
uLayering the communication process invokes breaking down the
communication puzzle into smaller and easier to handle interdependent
pieces.
uEach layer deals with a specific aspect of communication &
provides an interface to the layer above.
uThe set of operations define the service provided by that layer.
uAs a message sent by the top layer is passed on to the next lower layer
,a header may be prepended to the message.Some layers add both a
header and a trailer.
uEach layer then strips the header (trailer), handles the message using
the protocol provided by the layer and passes it on to the next higher
layer.
uThe lowest layer transmits the message over the network to the
receiving machine. It communicates with the most bottom layer of the
receiver.
Layer 1. Physical Layer
This is the bottom layer in the OSI reference model.
It accepts frames of data from its upper layer ie,Data Link layer and
transmits the content one bit at a time.
It also receives the incoming streams of data and passes it on to the
Data Link layer for reframing.
The layer is mainly concerned with :
Voltage of the electric current uses to transport the signal.
The type of media used for transmission and impedance
characteristics.
The physical shape of the connector used to terminate the
media.

Many standards have been developed, e.g. RS-232 (for


serialcommunication lines).
Physical Layer Implementation
Layer 2 : Data Link Layer
This layer is responsible accepts the binary streams from the
Physical layer , reassembles the bits them into frames .

Handles errors in the physical layer and also ensures that the
frames reaches the destination .
Any errors are detected and corrected .

Adds some bits at the beginning and end of each frame plus the
checksum. Receiver verifies the checksum.

If the checksum is not correct, it asks for retransmission. (send a


control message)
Consists of two sublayers:

Logical Link Control (LLC) defines how data is transferred over


the cable and provides data link service to the higher layers.
Provide three type of service
Unacknowledged connectionless services
Acknowledged connectionless service
Connection-oriented services

Medium Access Control (MAC) defines who can use the network
when multiple computers are trying to access it simultaneously
(i.e. Token passing, Ethernet [CSMA/CD]).
Layer 1 and Layer 2 are required for all types of
communication
irrespective of whether it is LAN or WAN.
Layer 3 : Network Layer

The Network Layer establishes the communications with computer


systems that exist beyond the LAN segment and is concerned with
the transmission of packets.
It does not have any native error detection / correction mechanisms .
It establishes a route between the originating and destination
computers and for reliability depends on the Data Link Layer &
chooses the best path to send a packet ( routing ).
It has its own routing architecture and uses protocols like IP ,IPX.
Supports two general types of protocols.
(Protocols give rules and standards that specify how the
communication devices communicate. )

Connection-Oriented :
Sender and receiver first establish a connection, possibly
negotiate on a protocol. (virtual circuit)
Transmit the stream of data.
Release the connection when done.

Eg.Telephone connection.
Connectionless
No advance setup is needed.
Transmit the message ( datagrams ) when sender is ready.

E.g. surface mail


Layer 4. The Transport Layer
uThe Transport layer also ensures reliability of data
transmission like the Data Link layer. (Network layer does not
deal with lost messages. )

uWhile the Data Link layer is confined within the LAN , the
Transport layer provides this function beyond the LAN
segment.
uData arrives as a sequence of packets and this layer identifies
the original sequence and resequencing to retain the original
sequence before they are passed to the Sessions layer up.

uBreaks the message (from sessions layer) into smaller


packets, assigns sequence number and sends them.

uReliable transport connections are built on top of X.25 or IP.


Datagram fragmentation
Protocols used :
TCP : (Transport Control Protocol) Internet transport
protocol. TCP/IP Widely used for network/transport layer
(UNIX).

UDP (Universal Datagram Protocol) : Internet connectionless


transport layer protocol.

(Application programs that do not need connection-oriented


protocol generally use UDP. )
Every IP datagram is an
individual entity and may take
a different route
Layer 5 : The Session Layer
The flow of communications during the connection between two
computer systems is maintained by this layer .
This flow of communication is called a session.
The layer ensures that a new request is accepted only when one
request is completed.

Layer 6 : The Presentation Layer


The data encoding is managed by the Presentation Layer .
It provides translation between incompatible data encoding
schemes ,such as ASCII ( American Standard Code for
Information Interchange ) & EBCDIC (Extended Binary Coded
Decimal Interchange Code).
Layer 7: The Application Layer

This layer provides an interface between the user applications


and the Network Services .
It initiates the Communications session .

Electronic mail, file transfer, connecting remote terminals, etc.

E.g. SMTP, FTP, Telnet, HTTP, etc.


Information Formats
• The data and control information that is
transmitted through internetworks takes a
wide variety of forms
• Common information formats include
frame, packet, datagram, segment, message,
and data unit
Information Formats
• Frames
– Is an information unit whose source and
destination are data link layer entities
– Is composed of the data-link layer header (and
possibly a trailer) and upper-layer data
– Data from upper-layer entities is encapsulated in
the data-link layer header and trailer
Information Formats
• Packets
– is an information unit whose source and
destination are network-layer entities
– is composed of the network-layer header (and
possibly a trailer) and upper-layer data
– Data from upper-layer entities is encapsulated in
the network-layer header and trailer
Information Formats
• Datagram
– Datagram usually refers to an information unit whose
source and destination are network-layer entities that use
connectionless network service
• Segment
– Segment usually refers to an information unit whose source
and destination are transport-layer entities
• Message
– message is an information unit whose source and
destination entities exist above the network layer (often
the application layer)
TCP/IP Model

TCP/IP Protocol layering is also called the DoD Model.

Application/Process

Host to Host layer

Internetwork Layer

Network Access layer


Comparison of OSI model with TCP/IP model
Network Access layer : Represents the physical connection
components such as cables,transceivers ,network bands,Lan Access
Protocols such as CSMA/CD for Ethernet and token access for
Token ring)
Internet layer provides a logical address for the physical network
interface.Using ARP & RARP ,this layer provides a mapping
between the logical address & physical address provided by the
network layer.
Host -to-Host protocol implements connections between hosts using
TCP and UDP
Process/Application layer provides applications like Telnet , ftp ,
SMTP ,SNMP that use the Host-to-Host layer protocols .
Data Flow between the TCP /IP networks

Message
Application Application

Segment
Transport Transport

Datagram
Network Network
Frame

Data link and Bits Data link and


Physical Physical
TCP/IP Implementation Hierarchy

Application/Process FTP,Telnet,SMTP,SNMP

Host to Host layer TCP & UDP

Routing
Internetwork Layer Protocols,IP,ARP,RARP

Network Access layer Token Ring,FDDI,Ethernet


Internetworking Protocol Stacks

Layer 3

Layer 3, the network layer provides the mechanisms that


enable the transfer of information between source and
destination machines across a communications network.

This layer is formed by converting Layer 2 frames and


addressing into Layer 3 packets with addressing that is
recognizable outside the LAN. These packets are then
routed to their destination.

An example of a Layer 3 routed protocol is the Internet


Protocol (IP).
There are two types of networking protocols that operate
at Layer 3:

routed protocols and routing protocols.

•Routed protocols are those that encapsulate user


information and data into packets, and are responsible
for transporting them to their destination.

•Routing protocols are used between routers to determine


available routes, communicate what is known about
available routes, and forward routed protocol packets
along those routes.
Layer 4 :

Whereas Layer 3 provides internetwork data transfers,


Layer 4 (the transport layer) provides Layer 3 network
mechanisms with end-to-end reliability and integrity.

The transport layer may be required to guarantee


error-free delivery of packets sequencing of delivered
packets, and quality of service.

An example of a Layer 4 protocol is the Transmission


Control Protocol (TCP). TCP is almost always referred
to in combination with its Layer 3 counterpart as
TCP/IP.
•The use of Layers 3 and 4 implies that the source and
destination computers are not connected to the same
LAN, regardless of how close or distant they are.

•Thus, internetworking two different networks is required


to support the requested transmission. Consequently, the
communications mechanisms of Layer 2 are inadequate.

•Conversely, these layers are not always required. For


example, if both the source and destination computers are
connected to the same LAN, they may communicate
satisfactorily using only Layer 2 network frames and
protocols.
The Process/Application Layer

•The process/application layer provides protocols for remote access


and resource sharing.

•Familiar applications such as Telnet, FTP, SMTP, HTTP, and


many others all reside and operate in this layer and depend upon
the functionality of the underlying layers.
The Host-to-Host Layer

The IP host-to-host layer correlates loosely to the OSI Reference


Model's session and transport layers. It consists of two protocol
entities: Transmission Control Protocol (TCP) and User Datagram
Protocol (UDP).

A third entity is being defined to accommodate the increasingly


transaction-oriented nature of the Internet. This protocol entity is
tentatively called Transaction Transmission Control Protocol
(TTCP).

TCP provides a connection-oriented data transmission between two


or more hosts, can support multiple data streams, and provides for
flow and error control, and even for the reordering of packets that
may have been received out of order.
The TCP protocol header is a minimum of 20 octets and contains
the following fields:

•TCP Source Port:

The 16-bit source port field contains the number of the port making
the "call." The source port and source IP address function as the
packet's return address.

•TCP Destination Port:

The 16-bit destination port field is the address of the "called," or


destination, port. The IP address is used to forward the packet to the
correct destination machine. At this point, the TCP Destination Port
is used to forward the packet to the correct application on that
machine.
•TCP Sequence Number:

The 32-bit sequence number is used by the receiving computer to


reconstruct the fragmented data back into its original form. In a
dynamically routed network, it is quite possible for some of the
packets to take different routes and, consequently, arrive out of
order. This sequencing field compensates for any inconsistency of
delivery.

•TCP Acknowledgment Number

TCP uses a 32-bit acknowledgment (ACK) of the next expected


octet. The number used to identify each ACK is the sequence
number of the packet being acknowledged.
•Data Offset:
This 4-bit field contains the size of the TCP header, measured in 32-bit
words.

•Reserved: This 6-bit field is always set to zero.

•Flags:

The 6-bit flags field contains six 1-bit flags that enable the control
functions of the urgent field, the acknowledgment of significant field,
push,reset connection, synchronize sequence numbers, and finished
sending data.

•Window Size (16 bits):

This field is used by the destination machine to tell the source host how
much data it is willing to accept, per TCP segment.
•Checksum (16 bits):

The TCP header also contains an error checking field known as a


checksum. The source host calculates a mathematical value,based
upon the segment's contents. The destination host performs the same
calculation. If the content remained intact, the result of the two
calculations is identical, thereby proving the validity of the data.

•Padding:

Extra zeros are added to this field to ensure that the TCP header is
always a multiple of 32 bits.
UDP

•The User Datagram Protocol (UDP) is IP's other host-


to-host (or transport) layer protocol. UDP provides a
basic, low-overhead, data transmission mechanism
known as a datagram.

•The simplicity of datagrams makes UDP inappropriate


for some applications, but perfect for more sophisticated
applications that can provide their own connection-
oriented functionality.
The Internet Layer

•The Internet, or network, layer of IPv4 consists of all the


protocols and procedures necessary to allow data
communications between hosts to traverse multiple networks.
This means that the data-bearing packets must be routable.

•The Internet Protocol (IP) is responsible for making data


packets routable.
The IP header is a minimum of 20 octets long, and has the
following structure:

•Version: The first four bits of the IP header identify the operating
version of IP, such as version 4.

•Internet Header Length: The next four bits of the header contain
the length of the header, expressed in multiples of 32.

•Type of Service: The next eight bits contain 1-bit "flags" that can
be used to specify precedence, delay, throughput, and reliability
parameters for that packet of data.

•Total Length: This 16-bit field contains the total length of the IP
datagram measured in octets. Valid values can range from 576 to
65,535 octets.
•Identifier: Each IP packet is given a unique, 16-bit identifier.

•Flags: The next field contains three 1-bit flags that indicate whether
fragmentation of the packet is permitted and if it is used.

• Fragment Offset: This 8-bit field measures the "offset" of the


fragmented contents relative to the beginning of the entire datagram.
This value is measured in 64-bit increments.

•Time to Live (TTL): The IP packet cannot be permitted to roam


the widearea network in perpetuity. It must be limited to a finite
number of "hops.”

The 8-bit TTL field is incremented by 1 for each "hop" it makes.


After reaching its maximum limit, the packet is destroyed.
(IP packets are forwarded across different networks by devices
known as routers. Each router that a packet passes through is
considered a hop. Establishing a maximum hop count ensures
that packets do not loop continuously in a dynamically routed
network. )

Protocol: This 8-bit field identifies the protocol that follows the IP
header, for example, VINES, TCP, UDP, and so on.

Checksum: The checksum field is a 16-bit error-checking field. The


destination computer, or any gateway nodes in the network, may
recompute the mathematical calculation on the packet's contents as
the source computer did. If the data survived the trip intact, the
results of these two calculations is identical. This field also informs
the destination host of the amount of incoming data.
Source IP Address:

The source address is the Internet address of the source computer.

Destination IP Address:

The destination address is the Internet address of the destination


computer.

Padding:

Extra zeros are added to this field to ensure that the IP header is
always a multiple of 32 bits.
Protocol Multiplexing & Demultiplexing

I . When ETHERNET receives a packet ,it uses a 2 byte Ethertype


field that is a part of the frame to determine the protocol to be used .

II . When IP receives a packet from Ethernet ,it has to distinguish


packets for TCP & UDP .This is done by examining a 8 bit Protocol
Id field of the IP Packet which can be found in the file
\SystemRoot\System32\drivers\etc\protocol
eg : 6- TCP
1- ICMP
17 - UDP
III. When TCP or UDP receives the packet from IP layer ,they
have to distinguish whether they are to be processed by
FTP,TELNET etc.
This is done by examining a 16 bit port number field in their
respective packets .The port number values can be found in the
file:
\ SystemRoot \System32\drivers\ etc\services
Eg 110 - POP3
23 - Telnet
25 - SMTP
20 -FTP data port
21 - FTP control port
Addressing Method in the TCP/IP Model

IP Layer Addressing method

Process/Application Host name

Host-to-Host Port Number

Internet IP address

Network Access Hardware address /MAC


address
Network Addressing
• Network addresses identify devices separately
or as members of a group
• Addressing schemes vary depending on the
protocol family and the OSI layer
– Media Access Control (MAC) addresses
– Network-layer addresses (IP Addressing)
Network Addressing
• MAC Addressing
– MAC addresses identify network entities in LANs that
implement the IEEE MAC addresses of the data-link
layer
– MAC addresses are unique for each LAN interface
– MAC addresses are 48 bits in length and are expressed as
12 hexadecimal digits, first 6 hexadecimal digits identify
the manufacturer and the last 6 hexadecimal digits
comprise the interface serial number
Network Addressing
• IP addressing
– Represented by 32 bit numbers called IP
addresses
– This is a logical address and is
independent of the underlying network
hardware or the network type
IP Address Classes (Class A,B,C,D,E)

0 8
0 netid hostid Class A

0 1 16
netid hostid Class B
1 0

0 1 2 24
Class C
1 1 0 netid hostid

0 1 2 3
1 1 1 0 multicast Class D

Class E
1 1 1 1 0 Reserved for future use
1. IP address consists of two parts :
network id and host id .

2. Most significant bits are used to determine how many bits are
used for netid & hostid.

3. Netid - Identifies the network uniquely


(Interconnected networks must have unique netids)
4. Hostid - Number of hosts that can be identified for a given
network depends on the number of bits in the hostid.
Address Class Number of networks Number of
nodes

A 127 16,777,214

B 16,383 65,534

C 2,097,151 254
Notation of IP address

The 32 bit number is represented as four decimal numbers


corresponding to the decimal value of the fours bytes that
make up the 32 bit address.

IP address 10010000 00010011 01001010 11001001


(in binary form)

IP address 144.19.74.201
(in dotted decimal notation)
Calculating an Address Class
The most significant bits in an IP address ( in the binary
form) determines the Class the Address belongs to.

Most significant bit IP Address Class

1 Class A
10 Class B
110 Class C
1110 Class D
Class A
Minimum value of first decimal 00000000 =0
Maximum value of first decimal 01111111 = 127

Class B
Minimum value of first decimal 10000000 = 128
Maximum value of first decimal 10111111 = 191

Class C
Minimum value of first decimal 11000000 = 192
Maximum value of first decimal 11011111 = 223
Special IP addresses

1. A host id of 0 & 1 is never assigned to an individual TCP/IP host.


2. An IP address with 0 as the host id represents the network itself
say , IP address 137.53.0.0 will represent the network 137.53
3. If a host id contains all 1’s in the bit pattern,it indicates a directed
broadcast address .This address can be seen by all nodes in the
network.
Say , 137.53 will have a broadcast address of
137.53.255.255
(Being a Class B ,16 bits are in hostid .If 1’s are used then it
corresponds to a value 255.255 ie,from137.53.11111111.11111111)
Subnet Masks

Once an IP network number has been assigned for a network,the


network administrator assigns values for the host number field.
Say, consider an IP network number 149.108.0.0.
Therfore 16 bits are assignable ===> 2 16 combinations
==>65536
(Since the pattern of all I’s and all 0’s cannot be used and so
65534 hosts are possible )
149.108.1.1
149.108.1.3
N
1

149.108.1.2
Internet
All traffic

149.108.0.0

N1 - Network 1
For a second network , the same network number cannot be used
as the router examines the netid and will not be able to
distinguish between the two networks.

OPTIONS : Go for a new network number


Use some of the bits in the hostid to distinguish
between the two networks .
This is called sub-netting and the resulting networks are called
SUBNETS
149.108.1.3 149.108.1.1 N
N1-Network 1
1

149.108.1.2

Internet

149.108.2.1
149.108.2.3 N
2
149.108.2.2
N2-Network 2
Subnetting :
Allows you to break a network into smaller networks using the
same network assignment .

Advantages

Simplified Administration
Restructuring of internal networks without affecting
external networks
Improved security.
Subnet Mask
Routers must understand how the subnetting has been done ,ie.
That the HostId is to be treated - a part for the subnet number and
the other for the host number .
This information is represented to the router as the Subnet Mask
Subnet Mask is used by routers and hosts on a subnet to
interpret the hostid field in such a way as to determine how
many bits are being used for subnetting.
Subnet Mask divides the hostid field into a subnet number and
host number .
netid hostid
Subnet
1 0 number Host number

IP address

11111111 11111111 11111111 00000000

Subnet Mask
Subnet Mask is a 32 bit number:
Ones (I’s ) correspond to the netid and subnet number
Zero’s (0’s) correspond to the host number in the IP address.
netid hostid
Subnet
1 0 number Host number

IP address

11111111 11111111 11111111 00000000

The above shows a Class B network number used for subnetting .


Eight bits are used for the Subnet number .
Subnet Mask of above can be represented as 255.255.255.0.
If a subnet mask of 255.255.0.0 is used for Class B address then it means
that no subnetting is used .
But if 255.255.0.0 is used for Class A address then subnetting is used .

If 255.255.255.0 is used for Class C then it means that no subnetting is


used .
But 255.255.255.0 used for Class B indicates that subnetting is used .
Identifier Conversion

Host name to Internet Address Conversion

When a user requests that a communication be setup between


a local host and a remote host , the local user refers to the
remote host using its host name .But the protocols operating
in the Host layer are concerned only with IP addresses and
not with host name .
Hence at Application layer needs to do a name resolution
using DNS .
Dest. Host name

Internet Address to Physical


Hardware address Host - B
The data unit in the Internet layer is IP
datagram which contains only IP Resolver
address and not the host’s physical using DNS
address .
For identifying the physical hardware 208.0.0.4
address the ARP is responsible .
The RARP is responsible for ARP
converting the physical hardware
address to Internet address.
Dest. Host Internet address
08002B00EE0B
Dest. NIC Physical H/W address

Você também pode gostar