Code monkey, not networking eng. Need to explain a broad overview, first.

cagamosisthingyΔίκτυα και Επικοινωνίες

27 Οκτ 2013 (πριν από 4 χρόνια και 16 μέρες)

177 εμφανίσεις

Code monkey, not networking eng.


Need to explain a broad overview, first.





























What kind of networks are there? (LAN/WAN)




























Open System Interconnection Model


Layer 1 = Lowest level

Layer 7 = Highest Level


1) Physical

-

Electrical / Physical connection


10XBASE
-
T

= Twisted Pair


ISDN/DSL

= copper Wire phone cord


802.11x


= Frequency


2) Data Link

-

Transfer between entities on a network & detect errors on the physical layer


-

Ethernet


-

Ethernet II


-

X
.25


-

Token Ring


-

802.11


-

PPP


-

PPTP


3) Network

-

Network to Network transfers


-

NetBEUI (NetBIOS Extended User Interface)


-

Internet Protocol (IP)


-

Secure Internet Protocol (IPSec)


-

Internetwork Packet Exchange (IPX)


4) Transport

-

host to h
ost transfers, end
-
to
-
end error checking, flow control


-

Transmission Control Protocol (TCP)


-

User Datagram Protocol (UDP)


-

Internet Control Message Protocol (ICMP)


-

Stream Control Transmission Protocol (SCTP)


-

Sequence Packet Exchange (SPX)


5) S
ession

-

establishes, manages, terminates connections


-

Named Pipes


-

NetBIOS (network basic input output system)


-

Remote Procedural Call (RPC)


6) Presentation
-

provides independence from differences in data representation (like encryption) by transla
ting from
application to network format and vice versa


-

Secure Sockets Layer


-

ASCII


-

Moving Picture Experts Group


7) Application
-

Application and end user processes. QoS is identified, user authentication and privacy considered.


-

Telnet


-

FTP


-

Simple Main Transfer Protocol


-

Hyper Text Transfer Protocol


-

Simple Object Access Protocol











Physical Layer


deals with Physical connections


10XBASE
-
T

= Twisted Pair

ISDN/DSL

= Copper Wire phone cord

802.11x

= Frequency





















































Data Link Layer


Only layer to work w/ software and hardware


data packets encoded/decoded into bits


2 layers: Media Access Layer & Logical Link Control


MAC sublayer controls how a comp on the network gains access to the
data and permission to transmit it


LLC layer controls frame synch, flow control, error checking


Mac
-
address: 48 bit value. (6 8
-
bit hex numbers), unique on the networking


Flow Control:


-

flow of data from 1 device to another.


-

ensure receiving devi
ce can handle all the incoming data


Manages and handles errors on the physical level


CRC:


-

hash function used to produce a checksum (small, fixed # of bits)


-

checksum compared to packet to check for errors





































Network
Layer


Provides switching and routing technologies


creates logical paths (virtual circuits) to transmit data from node to node


Deals with internetworking, congestion control, packet sequencing


internetworking: connecting LANs to form WANs, and connectin
g WANs to other WANs


Quality of Service:


must maintain the QoS defined by the transport later (guarantees a certain amount of bandwidth will be given)



IPv4



Version

-


always set to the value 4, which is the current version of IP

IP Header Length

-

number of 32
-
bit words forming the header, usually five)

Type of Service

-

now known as Differentiated Services Code Point. usually set to 0, but my indicate particular Quality of
Service needs from the network, the DSCP defines the way routers should qu
eue packets while they are waiting to be
forwarded

Size of Datagram

-

in bytes, this is the combined length of the header and the data

Identification

-

16
-
bit number which together with the source address uniquely identifies this packet
-

used during
reass
embly of fragmented datagrams

Flags

-

a sequence of three flags (one of the 4 bits is unused) used to control whether routers are allowed to fragment a
packet and to indicate the parts of a packet to the receiver

Fragmentation Offset

-

a byte count from
the start of the original sent packet, set by any router which performs IP router
fragmentation

Time To Live

-

Number of hops /links which the packet may be routed over, decremented by most routers
-

used to prevent
accidental routing loops

Protocol

-

Ser
vice Access Point which indicates the type of transport packet being carried (e.g. 1 = ICMP, 2= IGMP, 6
=TCP, 17=UDP)

Header Checksum

-

A 1's complement checksum inserted by the sender and updated whenever the packet header is
modified by a router
-

Used t
o detect processing errors introduced into the packet inside a router or bridge where the packet
is not protected by a link layer cyclic redundancy check. Packets with an invalid checksum are discarded by all nodes in an
IP network

Source Address

-

the IP
address of the original sender of the packet

Destination Address

-

the IP address of the final destination of the packet

Options

-

not normally used, but when used the IP header length will be greater than five 32
-
bit words to indicate the size of
the opt
ions field


IPv6

Version

Indicates the version of the Internet Protocol.

Traffic class

Previously the type
-
of
-
service (ToS) field in IPv4, the traffic class field defines the class
-
of
-
service (CoS)
priority of the packet. However, the semantics for thi
s field (for example, DiffServ code points) are identical to IPv4.

Flow labe l

The flow label identifies all packets belonging to a specific flow (that is, packet flows requiring a specific
class of service [CoS]); routers can identify these packets and h
andle them in a similar fashion.

Payload length

Previously the total length field in IPv4, the payload length field specifies the length of the IPv6 payload.

Next heade r

Previously the protocol field in IPv4, the Next Header field indicates the next ex
tension header to examine.

Hop limi t

Previously the time
-
to
-
live (TTL) field in IPv4, the hop limit indicates the maximum number of hops allowed.

Source address

Identifies the address of the source node sending the packet.

Destination addres s

Identif
ies the final destination node address for the packet.








Transport Layer


Provides transparent transfer of data between end systems (hosts)


responsible for end
-
to
-
end error recovery and flow control


ensures complete data transfer



Connection Orien
ted or Connectionless
-

Network layer only provides connectionless service, so this layer can implement
it.


Same Order Delivery
-

network layer doesn't generally guarantee the packets arrive in order sent, so transport layer can
choose to provide it


Chec
ksum used to try to detect errors.


Flow control to make sure the client is ready to receive the data


Ports are essential to address multiple entities at the same location (65,535 possible ports)








































NetBEUI


NetBIOS Ext
ended User Interface


Generally used in Microsoft networks.


It's not a routable protocol. Used in small to medium networks. Must be encapsulated in another protocol (like TCP) to be
used in a large network. Sometimes called the NetBIOS Frame (NBF) Proto
col


Name resolution:

1.IP broadcasting
-

a packet with the computer's name is broadcast when it's associated address is not in the local cache.
The host who has that name returns its address.

2.lmhost file
-

a file which maps IP addresses to NetBIOS com
puter names

3.NBNS
-

NetBIOS Name Server which maps NetBIOS names to IP addresses. WINS is an implementation.


NetBIOS, in the Session Layer, is used to control the sessions between computers and maintains connections.


Server Message Blocks (SMB), in the

Presentation Layer, provide a redirector client to server communications.


Finally, a Redirector in the Application Layer directs requests for network resources to the appropriate server and makes
network resources seem to be local resources.



TCP


4.Sou
rce port
-

16 bit number

5.Destination port
-

16 bit number

6.Sequence Number
-

32 bit number identifying the current position of the first data byte in the segment within the entire
byte stream before the TCP connection

7.Acknowledgment Number
-

32 bit nu
mber identifying the next data byte the sender expects from the receiver.

8.Header length
-

4 bit field that specified the total TCP header length in 32 bit words

9.Reserved
-

held for future use

10.Control Bits
-

urgent / acknowledge/reset/finished

11.Win
dow
-

16 bit integer used by the TCP for flow control

12.Checksum
-

16 bit number used to verify the integrity of the sent data

13.Urgent Pointer
-

16 bit field specifies the end of urgent data in the segment

14.Options
-

32 bit field for various options u
sed, like maximum segment size

15.Padding
-

Used to pad the option area to ensure it's 32 bits.

16.Data
-

Data to sent is place here, or left empty in acknowledgment packets.


Connection termination

Connection phaase uses (at most) 4
-
way handshake


When an

enpoint wants to stop it’s half of the connection it sends a FIN packet. Other end acknowledges w/ an ACK
packet (typical closure reqs FIN and ACK from each packet)


Half
-
Open connection = one side has ended, but other has not. Closed side can no longe
r send data, other side can


It is also possible for a 3
-
way handshake when host A sends a FIN and host B replies with a FIN & ACK (merely combines
2 steps into one) and host A replies with an ACK. This is perhaps the most common method.




UDP


1.Source p
ort
-

2 bytes

2.Destination port
-

2 bytes

3.Packet length
-

2 bytes

4.Checksum
-

2 bytes