Showing posts with label OSI layer. Show all posts
Showing posts with label OSI layer. Show all posts

Saturday, 26 October 2019

Redundancy in Layers 1 & 2 OSI Model | Network Redundancy Issues

Redundancy in Layers 1 & 2 OSI Model | Network Redundancy Issues

Redundancy in layers 1 and 2 of the OSI model and the problems of implementing a redundant network are described. Network redundancy is key to maintaining network reliability . Several physical links between devices provide redundant routes. In this way, the network can continue to operate if a single link or port failed. Redundant links can also share traffic load and increase capacity.
Several routes must be administered so that no loops occur in layer 2. The best routes are chosen, and an alternative route is available immediately in the event that a main route fails. Expansion tree protocols are used to manage layer 2 redundancy.

Redundancy in layers 1 and 2 of the OSI model

The three-tier hierarchical network design , which uses the core, distribution and access layers with redundancy, attempts to eliminate a single point of failure in the network. Several cable-connected routes between switches provide physical redundancy in a switched network. This improves the reliability and availability of the network. Having alternative physical paths for the data to cross the network allows users to access network resources, despite interruptions to the route.


  1. PC1 communicates with PC4 through a redundant network topology.
  2. When the network link between S1 and S2 is interrupted, the route between PC1 and PC4 is automatically adjusted to compensate for the interruption.
  3. When the network connection between S1 and S2 is restored, the route is re-adjusted to route traffic directly from S2 to S1 to reach PC4.

Route redundancy is a solution to provide the necessary availability of several network services by eliminating the possibility of a single point of failure.
Redundancy in layer 1 of the OSI model is represented by the use of several links and devices, but more than just physical planning is needed to complete the network configuration. For redundancy to work systematically, layer 2 protocols of the OSI model, such as STP , must also be used .

Problems with Redundancy

Redundancy is an important part of hierarchical design to avoid interrupting the delivery of network services to users. Redundant networks require the addition of physical routes, but logical redundancy must also be part of the design. However, redundant routes in a switched Ethernet network can cause physical and logical loops in layer 2.

  1. Physical loops in layer 2 can occur as a result of the normal operation of the switches, especially the discovery and forwarding process. When there are several routes between two devices in a network and no expansion tree protocols are implemented on the switches, a loop occurs in layer 2 . A loop in layer 2 can cause three main problems:
  2. Instability of the MAC database : the instability of the contents of the MAC address table is produced by receiving copies of the same frame on different ports of the switch. Data forwarding can be affected when the switch consumes resources that deal with instability in the MAC address table.
  3. Broadcast storms : switches can saturate the network with broadcasts incessantly if a process to avoid loops is not implemented. This situation is commonly known as "diffusion storm."

Multiple frame transmission : Multiple copies of the unicast frames may be delivered to the destination stations. Many protocols expect to receive a single copy of each transmission. Multiple copies of the same frame may cause errors that cannot be recovered.

Problem: Instability of the MAC database

Ethernet frames do not have a life time attribute (TTL) like IP packets. As a result, if there is no mechanism enabled to block the continuous propagation of these frames in a switched network, they continue to propagate between the switches incessantly, or until a link is interrupted and the loop is broken. This continuous propagation between switches can cause instability of the MAC database . This may occur due to the forwarding of broadcast frames.

Broadcast frames are forwarded through all switch ports, except for the original input port. This ensures that all devices in a broadcast domain receive the frame. If there is more than one route to resend the frame, an infinite loop can be formed. When a loop occurs, the MAC address table on a switch can constantly change with updates of broadcast frames, which causes the instability of the MAC database.
According to Image 2 :

  1. PC1 sends a broadcast frame to S2. S2 receives the broadcast frame in F0 / 11. When S2 receives the broadcast frame, it updates its MAC address table to record that PC1 is available on port F0 / 11.
  2. Because it is a broadcast frame, the S2 forwards the frame through all ports, including the Local_Link1 and the Local_Link2. When the broadcast frame reaches S3 and S1, they update their MAC address tables to indicate that PC1 is available on port F0 / 1 of S1 and on port F0 / 2 of S3.
  3. Since it is a broadcast frame, S3 and S1 forward the frame through all ports, except the input port. S3 sends broadcast frames from PC1 to S1. S1 sends broadcast frames from PC1 to S3. Each switch updates its MAC address table with the wrong port for PC1.
  4. Each switch resends the broadcast frame over all its ports, except the input port, which causes the two switches to forward the frame to S2.
  5. When S2 receives the broadcast frames of S3 and S1, the MAC address table is updated again, this time with the last input received from the other two switches.

This process is repeated again and again until the loop is broken by physically disconnecting the connections that cause it or by turning off one of the switches in the loop.

 Problem: Broadcast Storms

A broadcast storm occurs when there are so many broadcast frames trapped in a Layer 2 loop, that all available bandwidth is consumed . As a consequence, there is no bandwidth available for legitimate traffic and the network is no longer available for data communication. This is an effective denial of service.

Broadcast storm is inevitable in a network with loops. As more devices send broadcasts over the network, more traffic is concentrated in the loop, which consumes resources. Finally, a diffusion storm is created that causes the network to fail.
There are other consequences of broadcast storms, for example, it may cause the terminal to not work well because of the high processing requirements to maintain such a high traffic load in the NIC.

Detail of the problem with diffusion storms

According to Image 3 :


  1. PC1 sends a broadcast frame to the network with loops.
  2. The broadcast frame creates a loop between all interconnected switches in the network.
  3. PC4 also sends a broadcast frame to the network with loops.
  4. The broadcast frame of PC4 is also trapped in the loop between all interconnected switches, as is the broadcast frame of PC1.
  5. As more devices send broadcasts over the network, more traffic is concentrated in the loop, which consumes resources. Finally, a diffusion storm is created that causes the network to fail.
  6. When the network is completely saturated with broadcast traffic that generates a loop between the switches, the switch discards new traffic because it cannot process it.

Since devices connected to a network regularly send broadcast frames, such as ARP requests, a broadcast storm may form in seconds . As a result, when a loop is created, the switched network is quickly deactivated.

 Problem: Duplicate Unicast Frames

Broadcast frames are not the only type of frames that are affected by loops. Unicast frames sent to a network with loops can generate duplicate frames that reach the destination device.

Most upper layer protocols are not designed to recognize duplicate transmissions or deal with them. In general, protocols that use a sequence numbering mechanism assume that the transmission has failed and that the sequence number has been recycled for another communication session. Other protocols attempt to send the duplicate transmission to the appropriate upper layer protocol to be processed and possibly discarded.

Layer 2 LAN protocols, such as Ethernet, lack mechanisms to recognize and eliminate frames that form incessant loops . Some layer 3 protocols implement a TTL mechanism that limits the number of times a layer 3 network device can transmit a packet again. Layer 2 devices, which lack this mechanism, continue to relay the traffic that generates loops indefinitely. STP , a mechanism that serves to prevent loops in layer 2, was developed to address these problems.
To prevent these problems from occurring in a redundant network, some kind of expansion tree must be enabled on the switches . By default, the expansion tree is enabled on Cisco switches to prevent loops in Layer 2.

 Detail of the problem with diffusion storms

According to Image 4 :

  1. PC1 sends an unicast frame to PC4.
  2. The S2 does not have any input for PC4 in its MAC table, so it saturates all the ports of the switch with the unicast frame to try to find PC4.
  3. The frame reaches switches S1 and S3.
  4. S1 does not have a MAC address entry for PC4, so it resends the frame to PC4.
  5. S3 also has an entry in its MAC address table for PC4, so that it forwards the unicast frame through Trunk Link3 to S1.
  6. S1 receives the duplicate frame and forwards it to PC4.
  7. PC4 has now received the same frame twice.

Monday, 9 September 2019

Application Layer Protocols and Services

Application Layer Protocols and Services

In this article we will learn about application layer protocols and services . We will see how each of them works. Following is the list of most popular protocols of this layers:

TCP / IP application layer protocols table
ProtocolDescription
File Transfer Protocol (FTP)It is used for interactive transfer of connection-oriented files, requires ACK. TCP 20, 21
Trivial File Transfer Protocol (TFTP)It is used for simple and offline file transfer. UDP 69
Simple Mail Transfer Protocol (SMTP)It is used to transfer (send) messages and email attachments. TCP 25
Post Office Protocol (POP)It is used by email clients to retrieve and download email from a remote server. TCP 110
Internet Message Access Protocol (IMAP)Another protocol for retrieving email stored on a server. It keeps the messages on the server. TCP 143
Domain Name Service Protocol (DNS)It is used to resolve Internet names in IP addresses. TCP, UDP 53
Telnet: terminal emulation protocolIt is used to provide remote access to servers and network devices. TPC 23
Bootstrap Protocol (BOOTP)a precursor to the DHCP protocol. Network protocol used to obtain IP address information during startup. UDP 68 CUSTOMER, UDP 67 SERVER
Dynamic Host Configuration Protocol (DHCP)It is used to assign an IP address, a subnet mask, a default gateway and a DNS server to a host. UDP 68 CUSTOMER, UDP 67 SERVER
Hypertext Transfer Protocol (HTTP)It is used to transfer files that make up the Web pages of the World Wide Web. TCP 80, 8080
Safe Hypertext Transfer Protocol (HTTPS)The browser uses encryption to protect HTTP communications, authenticates the website. TCP, UDP 443

HTTP and HTML

When you type a web address or a uniform resource locator (URL) in a web browser, the browser establishes a connection to the web service that runs on the server using the HTTP protocol.

URL example: https://ccnacompletecourse.blogspot.com

First, the browser interprets the three parts of the URL:
  • https (the protocol or scheme)
  • ccnacompletecourse.blogspot.com (the name of the server)
Through the requirements of the HTTP protocol, the browser sends a GET request to the server and requests the file.

HTTP AND HTTPS

HTTP is a request / response protocol. When a client, usually a web browser, sends a request to a web server, HTTP specifies the types of messages that are used for that communication. The three types of common messages are GET, POST and PUT.
  1. GET is a request for data from the client. A web browser sends the GET message to the web server to request the HTML pages
  2. POST and PUT are used to send messages that upload data to the Web server.
Although HTTP is extremely flexible, it is not a secure protocol. In summary:
  • HTTP is not secure. The messages can be intercepted.
  • HTTPS uses authentication and encryption to secure data.

EMAIL PROTOCOLS 

  • Email is a storage and shipping method used to send, store and retrieve electronic messages.
  • Email messages are stored on mail servers.
  • Email clients communicate with email servers to send and receive email messages.
  • Mail servers communicate with other mail servers to transport messages from one domain to another.
  • Email depends on three separate protocols to work: SMTP, POP and IMAP.

SMTP OPERATION

SMTP message formats need a header and a message body. While the body of the message can contain the desired amount of text, the header must have a properly formatted recipient email address and a sender address.

When a client sends email, the client's SMTP process connects to a server's SMTP process on the well-known port 25 . After the connection is established, the client tries to send the email to the server through it. Once the server receives the message, it locates it in a local account (if the recipient is local) or forwards it to another mail server for delivery. The destination mail server may be disconnected or busy. In these cases, the SMTP queues the messages to send them later. The server periodically checks the queue for messages and tries to send them again. If the message has not yet been delivered after a predetermined expiration time, it will be returned to the sender as impossible to deliver.

POP OPERATION

POP is used by an application to retrieve email from a mail server. With POP, mail is downloaded from the server to the client and then deleted on the server. POP works this way, by default. POP3 is desirable for ISPs, as it lightens their responsibility for handling large amounts of storage for their email servers. The server starts the POP service by passively listening to client connection requests on TCP port 110 . When a client wishes to use the service, it sends a request to establish a TCP connection with the server. Once the connection is established, the POP server sends a greeting. Next, the client and the POP server exchange commands and responses until the connection is closed or canceled.

IMAP OPERATION

IMAP is another protocol that describes a method to retrieve email messages. Unlike POP, when the user connects to a server with IMAP capability, copies of the messages are downloaded to the client application . The original messages are kept on the server until they are manually deleted. Users see copies of the messages in their email client software.

Users can create a hierarchy of files on the server to organize and save mail. This file structure is also duplicated in the email client. When a user decides to delete a message, the server synchronizes that action and deletes the message from the server.

DYNAMIC HOST CONFIGURATION PROTOCOL (DHCP)

  • Dynamic Host Configuration Protocol (DHCP) allows a host to obtain an IP address dynamically.
  • The DHCP server is contacted and the address is requested; it chooses the address of a configured address range called "pool" and is granted to the host for a set period.
  • The addresses are returned to the pool for reuse when they are no longer in use.
  • DHCP is used for general-purpose hosts, such as devices for end users; Static addressing is used for network devices such as gateways, switches, servers and printers.

DHCP OPERATION

  • The client transmits a DHCPDISCOVER message whose destination is broadcast (L2 FF-FF-FF-FF-FF-FF and L3 255.255.255.255), to identify any DHCP server available on the network.
  • This request reaches all PCs on the Network but only the DHCP server responds to the host with a DHCPOFFER message.
  • The client sends a DHCPREQUEST message to the server that it wishes to use (in the case of several offers).
  • A client can also request an address previously assigned by the server.
  • The server returns a DHCPACK message to confirm that the grant has ended.

FILE TRANSFER PROTOCOL (FTP)

FTP is another application layer protocol that is commonly used:

  • An FTP client is an application that runs on a client computer and is used to insert and extract data on an FTP server.
  • FTP requires two connections between the client and the server: one for commands and responses (TCP port 21), and another for file transfer (TCP port 20) itself.
  • The client can download (extract) data from the server or upload (insert) data to the server.

SERVER MESSAGE BLOCK (SMB)

  • SMB is a client / server file exchange protocol.
  • All SMB messages share the same format.
  • Printing and file sharing services from SMB became the mainstay of Windows networks.
  • Microsoft products now support TCP / IP protocols to directly support the sharing of SMB resources.
  • Mac, LINUX and UNIX operating systems have their own SMB implementation.
  • After establishing the connection, the client user can access the resources on the server as if the resource were local to the client host.
SMB messages can:
  • Start, authenticate and end sessions
  • Control access to files and printers
  • Authorize an application to send or receive messages to or from another device

DOMAIN NAME SERVICE (DNS)

Domain names were created to convert numerical addresses into a simple and recognizable name. Of course, it is simpler to work with domain names than with IP numbers; In addition, if the IP address is changed, the end user does not need to know about the change.

DNS MESSAGE FORMAT

The DNS server stores different types of resource records used to resolve names. These records contain the name, address and type of record. The common DNS records are:
  • A : an IPv4 terminal address
  • NS : an authoritative name server
  • AAAA : a terminal IPv6 address
  • MX : a mail exchange record
  • DNS servers search their own records first, and relay the client's request to other servers if they cannot resolve it. Then the answer is forwarded to the client.
The ipconfig / displaydns command in Windows shows all DNS stored in the cache.

 DNS HIERARCHY

The DNS protocol uses a hierarchical system to create a database that provides name resolution. The hierarchy is similar to an inverted tree with the root at the top and the branches below

Top-level domains represent the type of domain or country of origin.

Examples of top-level domains are .com, .org, .au and .co. In the DNS hierarchy, top-level domain servers (.com, .gov, .edu) contain records of second-level domain servers. The second level domain name server (cisco.com, etc.) is an authoritative DNS server, since it keeps all the records of the cisco company.

What is Application Layer in OSI Model

What is Application Layer in OSI Model?

This article is a complete brief on What is Application Layer in OSI Model. We will explain the way in which the functions of the application layer, session layer and presentation layer operate together to provide network services to end-user applications.

WHAT IS THE APPLICATION LAYER?

The application layer is closest to the end user. As shown in the image, it is the layer that provides the interface between the applications used for communication and the underlying network in which messages are transmitted. Application layer protocols are used to exchange data between programs running on the source and destination hosts. The top three layers of the OSI model (application, presentation and session) define functions of the single TCP / IP application layer.

PRESENTATION LAYER

The Presentation Layer has three main functions:

  • The Format : Format the data of the source device, or present it, in a compatible way for the destination device to receive it
  • Compression : Compress the data so that it can be decompressed by the target device.
  • Encryption : Encrypt data for transmission and decrypt upon receipt. Common video standards include QuickTime and the Movie Expert Group (MPEG) .The common graphic image formats are: GIF, JPEG and PNG.

SESSION LAYER

As the name implies, the functions of the session layer create and maintain dialogues between the source and destination applications and also manage the exchange of information to initiate dialogues, to keep them active and to restart sessions. The so-called layer five of the OSI model, defines the connection of a user computer to a network server and from one computer to another in a network with peer-to-peer configuration.

TCP / IP APPLICATION LAYER PROTOCOLS

There are many application layer protocols, and they are constantly developing. Some of the best known application layer protocols include the hypertext transfer protocol (HTTP), the file transfer protocol (FTP), the trivial file transfer protocol (TFTP), the Internet message access protocol (IMAP) and the Domain Name System (DNS) protocol.
In summary:

  • Specify the control information and format necessary for common Internet functions.
  • They must be implemented on both the source and destination devices.
  • The application layer protocols that are implemented on the source and destination host must be compatible to allow communication.

INTERACTION OF APPLICATION PROTOCOLS WITH APPLICATIONS FOR END USERS

Finally, we see how application protocols interact with applications for end users:

CLIENT-SERVER MODEL


  • The device that requests information is called "client" and the device that responds to the request is called "server".
  • Client and server processes are considered part of the application layer.
  • The content of the data exchange will depend on the application in use.
  • Email is an example of a client and server interaction.

POINT-TO-POINT NETWORKS (PEER NETWORK - P2P)


  • Two or more computers can be connected to a P2P network to share resources without having a dedicated server.
  • Any connected terminal (known as "point") can function as a server and as a client.
  • Client and server functions are set by request.

A P2P application allows a device to function as a client and as a server within the same communication. In this model, each client is a server and each server is a client. P2P applications require that each terminal provide a user interface and run a background service.

TCP Vs UDP | Explanation and Comparison TCP UDP port Numbers

TCP Vs UDP | Explanation and Comparison

This article is about TCP Vs UDP protocol, Explanation and its difference. Also the reason why the TCP protocol is considered more reliable than UDP protocol. We will discus both protocol in details and in the end we will compare TCP and UDP.

TCP Protocol

The function of the TCP transport protocol is similar to sending packets that are tracked from source to destination. If a shipping order is divided into several packages, the customer can check the delivery order online.
There are three basic operations that enable reliability with TCP:

  1. The numbering and tracking of data segments transmitted to a specific host from a given application
  2. The acknowledgment of data receipt
  3. The retransmission of any data without acknowledgment after a certain period


  • TCP FEATURES


    • Connection oriented : create a session between the source and destination.
    • Reliable delivery : retransmit lost or damaged data.
    • Reconstruction of ordered data : numbering and sequencing of segments to rearm data in the correct order.
    • Flow control : regulates the amount of data that is transmitted since network hosts have limited resources, such as memory or processing capacity.
    • Protocol with status : tracks the session.


  • TCP HEADER


TCP is a protocol with status information, that is, it tracks the status of the communication session. TCP adds 20 bytes of overhead to the segment header

    • Source port (16 bits) and destination port (16 bits) : used to identify the application.
    • Sequence number (32 bits) : used to rearm data.
    • Recognition number (32 bits) : indicates the data received.
    • Header length (4 bits) : known as “data offset”. Indicates the length of the TCP segment header.
    • Reserved (6 bits) : this field is reserved for the future.
    • Control bits (6 bits) : includes bit codes, or markers, that indicate the purpose and function of the TCP segment.
    • Window size (16 bits) : indicates the number of bytes that can be accepted at a time.
    • Checksum (16 bits) : used to verify errors in the header and segment data.
    • Urgent (16 bits) : indicates if the information is urgent.

  • TCP COMMUNICATION PROCESS
    • Each application process that runs on the server uses a port number.
    • An individual server cannot have two services assigned to the same port number within the same transport layer service.
    • An active server application assigned to a specific port is considered open.
    • There may be many ports open simultaneously on one server, one for each active server application.

A TCP connection is established in three steps:
    • The source client requests a client-to-server communication session with the server.
    • The server acknowledges receipt of the client-to-server communication session and requests a server-to-client communication session.
    • The source client acknowledges receipt of the server-to-client communication session.
The TCP FIN indicator (completion control marker) is set in the segment header to terminate a TCP connection.
    • When the client has no more data to send in the transmission, it sends a segment with the FIN indicator set.
    • The server sends an ACK to acknowledge the FIN to receive the client-to-server session.
    • The server sends an END to the client to end the session from server to client.
    • The client responds with an ACK to acknowledge the FIN from the server.
    • Once all segments are recognized, the session is closed.

  • TCP THREE-WAY LINK PROTOCOL

To establish the connection, the hosts make a three-way link. The three way link:
    • It states that the target device is present in the network.
    • Verify that the destination device has an active service and accept requests on the destination port number that the source client wishes to use for the session.
    • Inform the destination device that the source client tries to establish 
    • a communication session on that port number
TCP control bit fields table
CountrysideDescription
URGimportant urgent pointer field
ACKimportant field of constitution
RSTrestore connection
SYNsynchronize sequence numbers
FINISHno more issuer data
The three steps during a three-way TCP link protocol are SYN, SYN-ACK and ACK.

  • TCP RELIABILITY
    • TCP segments use sequence numbers to reassemble the segments in the original order.
    • During the configuration of the TCP session, a random initial sequence number (ISN) is chosen. Then, the ISN increases with the number of bytes transmitted.
    • The data is delivered to the application layer only when it has been received and completely reassembled.
  • TCP FLOW CONTROL

TCP also offers flow control mechanisms, the amount of data that the destination can receive and process with reliability. The flow control allows to maintain the reliability of the TCP transmission by adjusting the speed of the data flow between the source and the destination for a given session. To achieve this, the TCP header includes a 16-bit field called " window size ".

    • Window size : amount of data that an origin can transmit before receiving an acknowledgment. It determines the amount of data that the target device of a TCP session can accept and process at a time.
    • The acknowledgment of receipt . It is the next byte that the destination expects to receive.
    • Finally, network congestion usually results in packet discarding.

UDP PROTOCOL

UDP provides the basic functions to distribute data segments among the appropriate applications, with very little overhead and data checking. While TCP's reliability functions provide stronger communication between applications, they also represent an additional overhead and may cause transmission delays. There is a trade-off between the value of reliability and the burden that it implies for network resources. Adding overhead to ensure reliability for some applications could reduce the utility to the application and even be harmful.

UDP is ideal for applications that do not require reliability.

  • UDP FEATURES
    • Without connection
    • Less transmission delays.
    • There is no reconstruction of ordered data (performed by the application)
    • Unreliable Delivery
    • No flow control
    • Stateless protocol, neither the client nor the server is obliged to track the status of the communication session.
  • UDP HEADER

UDP is a protocol without status information, so if reliability is desired it must be handled by the application layer. Portions of communication in UDP are called datagrams and UDP adds only 8 bytes of overhead.

  • UDP COMMUNICATION PROCESS

UDP datagram reset
    • UDP simply reassembles the data in the order in which they were received and sends them to the application.
    • If necessary, the application must identify the correct sequence.
UDP server processes and requests
    • UDP-based server applications are assigned known or registered port numbers.
    • Requests received at a specific port are forwarded to the appropriate application based on the port numbers.
UDP client processes
    • The UDP client process dynamically selects a port number and uses it as the source port.
    • Typically, the destination port is the known or registered port number that is assigned to the server process.
    • The same pair of source or destination ports is used in the header of all datagrams used in the transaction.
    • When returning data from the server to the client, the source and destination port numbers are reversed in the datagram header.

SEVERAL CONVERSATIONS SEPARATELY

The transport layer separates and manages several communications with different transport requirements. 
  • Different applications send and receive data on the network simultaneously.
  • TCP and UDP manage these different simultaneous conversations through header fields that can uniquely identify these applications.
These unique identifiers are port numbers.
he source port number is associated with the application that originates the communication on the local host and the destination port is used to identify an application on the server (destination) -> remote host.
UDP and TCP Port Number
Port NumberProtocolApplicationAcronym
20TCPFile Transfer Protocol (data)FTP
21TCPFile Transfer Protocol (control)FTP
22TCPSafe ShellSSH
23TCPTelnet-
25TCPSimple File Transfer ProtocolSMTP
53TCP, UDPDomain Name ServiceDNS
67UDPDynamic host configuration protocol (server)DHCP
68UDPDynamic host configuration protocol (client)DHCP
69UDPTrivial File Transfer ProtocolTFTP
80TCPHypertext Transfer ProtocolHTTP
110TCPPost Office Protocol version 3 (Post Office Protocol version 3)POP3
143TCPInternet Message Access ProtocolIMAP
161UDPSimple Network Management ProtocolSNMP
443TCPSecure hypertext transfer protocolHTTPS
A server can offer more than one service simultaneously, for example, web services (80) and FTP connection (21)

PORT NUMBER GROUPS

The Internet Assigned Numbers Authority (IANA) is the regulatory body responsible for assigning different addressing standards, including port numbers. There are different types of port numbers:


  • Well-known ports : These numbers are reserved for services and applications. (For example: web browsers, email clients)
  • Registered ports : These port numbers are assigned to an entity that requests them for use with specific processes or applications. For example, Cisco port 1985 for its routing process (HSRP).
  • Dynamic or private ports : (or ephemeral) The client OS dynamically assigns them when a connection to a service is initiated.

Port Number Groups Table
Port Number RangePort Group
Between 0 and 1023Well-known ports
From 1024 to 49151Registered Ports
From 49152 to 65535Dynamic or private ports

THE NETSTAT COMMAND

It is used to inspect TCP connections that are open (active) and running on the network host. The netstat command will attempt to resolve IP addresses in domain names and port numbers in known applications. The -n option can be used to display IP addresses and port numbers in their numerical format.

TCP OR UDP

Which transport layer protocol is correct for the appropriate application? For some applications, the segments must arrive in a very specific sequence so that they can be processed correctly. With other applications, the data is considered useful once all are received in full. In both cases, TCP is used as the transport protocol

  • TCP is better for databases, web browsers, email clients, etc. (Telnet, FTP, SMTP, HTTP)

In other cases, an application can tolerate some data loss during transmission over the network, but transmission delays are not allowed. UDP is the best option for these applications, since less network overhead is required.


  • UDP is better for live streaming audio or video, VoIP, etc. (TFTP, IPTV, DHCP, DNS SNMP, VoIP)


What is the Transport Layer Responsibilities & Function

What is the Transport Layer Responsibilities & Function


In this we will describe What is the Transport Layer Responsibilities & Function in the administration of data transport in end-to-end communication.
What is the Transport Layer ?
The transport layer, or layer four of the OSI model, manages the flow of information from one network node to another. Its main function is to establish a temporary communication session between two applications and to transmit data between them. TCP / IP uses two protocols to achieve this:

  • Transmission Control Protocol (TCP)
  • User Datagram Protocol (UDP)

Responsibilities OF the Transport Layer

The tasks of the transport layer are as follows:


  • Track individual conversations between applications on the source and destination hosts : In the transport layer, each set of data that flows between a source and a destination application is known as a “conversation”. A host can have several applications that communicate over the network simultaneously
  • Segment data for administration and reassemble segments at the destination : Transport layer protocols have services that segment application data into blocks of an appropriate size. These services include the necessary encapsulation in each piece of data.
  • Identify applications : The transport layer assigns an identifier to each application, called a port number. All software processes that require access to the network are assigned a unique port number for that host.


Multiplexing Conversation

Sending some types of data (such as a video stream) through a network, such as a full flow of communication, can consume all available bandwidth. This will prevent other communications from occurring at the same time. It could also hinder error recovery and re-transmission of damaged data.

How to solve it? through the segmentation of data into smaller parts, allowing multiple communications of different users to be interlaced (multiplexed) on the same network.



DATA SEGMENTATION

It allows multiple different communications from several different users to be interlaced (multiplexed) on the same network simultaneously.
It provides the means to send and receive data during the execution of several applications.
A header is added to each segment to identify it.

RELIABILITY OF THE TRANSPORT LAYER

While the IP deals only with the structure, addressing and packet routing. Transport protocols specify the way in which messages are transferred between hosts . TCP / IP provides two transport layer protocols: the transmission control protocol (TCP) and the user datagram protocol (UDP). IP uses these transport protocols to enable communication and data transfer between hosts.
TCP is considered a reliable and complete transport layer protocol, as it ensures that all data reaches the destination. However, this requires additional fields in the TCP header that increase the packet size and also the delay. In contrast, UDP is a simpler transport layer protocol, although it does not provide reliability. Therefore, it has fewer fields and is faster than TCP. We will analyze it later.


Wednesday, 21 August 2019

Network Layer Protocols

Network Layer Protocols

Let's see how many network layer protocols exist and which ones are usually implemented. Also the IPv4 and IPv6 packages.

NETWORK LAYER

The network layer or layer 3 of the OSI model provides services to allow the terminals to exchange data on the network. The Network layer uses 4 basic processes (End-to-end transport processes):


  • Terminal Addressing : The terminals must be configured with a unique IP address to identify them in the network.
  • Encapsulation : The network layer encapsulates the protocol data unit (PDU) of the transport layer to a packet (add IP header information)
  • Routing or Routing : The network layer provides services to direct packets to a destination host on another network
  • Decapsulation : Once the network layer uncapsulates the packet, the layer 4 PDU that is obtained is transferred to the appropriate service in the transport layer.

Each router that crosses a packet before reaching the destination host is called a "jump."

NETWORK LAYER PROTOCOLS

There are several network layer protocols. However, there are only two network layer protocols that are usually implemented:


  • Internet Protocol version 4 (IPv4)
  • Internet Protocol version 6 (IPv6)

Old Network Layer Protocols


  • Novell internetwork packet exchange (IPX)
  • AppleTalk
  • Offline network service (CLNS / DECNet)

IP FEATURES

IP was designed as a protocol with low overhead.  This means that it only provides the necessary functions to send a packet from a source to a destination through an interconnected network system. The protocol was not designed to track or manage packet flow.

The following describes the basic characteristics of IP:

IP: NO CONNECTION

IP has no connection, which means that an exclusive full connection is not generated before sending the data and then the following happens:


  • The sender does not know if the receiver is listening or if the message arrived on time.
  • The receiver does not know that data is coming.

 IP: MINIMUM SERVICE DELIVERY

To be unreliable means that IP does not have the functionality to manage or recover packets not received or damaged . This is because, although IP packets are sent with information about the delivery location, they do not have information that can be processed to inform the sender if the delivery was successful.

IP: INDEPENDENT OF THE MEDIA

Regardless of the means it means that the transport of IP packets is not limited to a particular medium (it can be transmitted by copper cables, optical signals or wireless radio signals). However, the network layer takes into account one of the most important characteristics of the medium, the " maximum transmission unit " (MTU) which is the maximum size of PDUs that each medium can carry.

The data link layer passes the MTU value to the network layer. The network layer then determines what size the packets can be. A router must divide the packet when it is forwarded from one medium to another with a lower MTU. This process is called " packet fragmentation " or "fragmentation."

Tuesday, 20 August 2019

Ethernet Protocols and Features

Ethernet Protocols and Features 

In this article you will learn about the Ethernet Protocols and Features. Ethernet is the predominant LAN technology in the world and works in the data link layer and in the physical layer. The Ethernet protocol standards define the format, size, timing and coding of frames in a network communication; It is therefore important to know the Ethernet standards that define Layer 2 protocols and Layer 1 technologies.

Ethernet has evolved since its creation in 1973. The first versions of Ethernet were relatively slow, with a speed of 10 Mbps, while the most recent ones run at 10 Gbps and even faster.

Some Key features of Ethernet are:


  • Most used LAN technology.
  • It works in the data link layer and in the physical layer.
  • Family of network technologies defined in the IEEE 802.2 and 802.3 standards.
  • Supports data bandwidths of 10, 100, 1000, 10,000, 40,000 and 100,000 Mbps (100 Gbps).

ETHERNET ENCAPSULATION

As I mentioned, Ethernet works in layer 1 and layer 2, and precisely, it operates in two separate sub-layers of the data link layer :

  1. Logic Link Control (LLC) 
  2. MAC 

SUBLAYER LLC

The LLC Sublayer (Logical Link Control or Logical Link Control) is implemented by software (its implementation is hardware independent) and is used to communicate with the upper layers of the protocol suite. The LLC takes the protocol data from the network, which is usually an IPv4 packet, and adds control information to help distribute the packet to the destination node. On a computer, the LLC can be considered the NIC driver software. The NIC controller is a program that interacts directly with the NIC hardware to transfer data between the MAC sublayer and physical media.


 MAC SUBLAYER

The MAC sublayer (Media Access Control or Media Access Control) constitutes the lower sublayer of the data link layer and is implemented by hardware, usually in the NIC of the PC.
It has two main responsibilities:


  • Data encapsulation : Includes frame arming before transmission and frame disarming at the time of reception and provides three main functions:
  • Frame delimitation : used to identify a group of bits that make up a frame. These delimiter bits provide synchronization between the transmission and reception nodes.
  • Addressing : The encapsulation process contains the Layer 3 PDU and also provides data link layer addressing.
  • Error detection : each frame contains a trailer used to detect transmission errors.


To assemble the frame, the MAC layer adds a header and a trailer to the PDU of the network layer.


  • Media access control : It is responsible for placing the frames in the media and removing them from them (hence the name). This sublayer communicates directly with the physical layer.

The underlying logical topology of Ethernet is a multi-access bus in which all devices (nodes) of a single network segment share the medium. Ethernet is a contention network method, where any device can attempt to transmit data through the shared medium as long as it has data to send. To detect and resolve collisions, the process of multiple access by carrier detection with collision detection (CSMA / CD) in the mid-duplex Ethernet LANs is used.

ETHERNET FRAME FIELDS

The Ethernet II and IEEE 802.3 standards define that the minimum Ethernet frame size is 64 bytes, and the maximum is 1518 bytes and the following are taken into account:


  • A length less than 64 bytes is considered a “collision fragment” or “runt frame”.
  • All frames that are smaller than the minimum or greater than the maximum are discarded.
  • It is possible that discarded frames originate in collisions or other unwanted signals and, therefore, are considered invalid.

Ethernet frame Fields table
FIELDSDESCRIPTION
Preamble and Frame Start DelimiterThe Preamble (7 bytes) and Frame Start Delimiter (SFD) fields, also called “frame start” (1 byte), are used for synchronization between sending and receiving devices.
Destination MAC addressThis 6-byte field is the identifier of the desired recipient.
Source MAC addressThis 6-byte field identifies the NIC or the source interface of the frame.
EtherTypeThis 2-byte field identifies the upper layer protocol encapsulated in the Ethernet frame.
DataThis field (46 to 1500 bytes) contains the encapsulated data of an upper layer, which is a Layer 3 PDU (an IPv4 packet). All frames must be at least 64 bytes long.
FCS (Frame Verification Sequence Field)(4 bytes) is used to detect errors in the frame. Use a cyclic redundancy check (CRC), if the calculations match the source and the receiver, no error occurred.

ETHERNET MAC ADDRESSES

An Ethernet MAC address is a 48-bit binary value expressed as 12 hexadecimal digits (4 bits per hexadecimal digit).

The decimal system is a base 10 number system, the hexadecimal system is a base 16 system, use the numbers from 0 to 9 and the letters from A to F

It's important to know:

  • The hexadecimal system is represented in writing by means of the value preceded by "0x". Example: "0x0A" and "0x73"
  • The hexadecimal value is used to represent Ethernet MAC addresses and IP addresses version 6 (IPv6).

MAC ADDRESS STRUCTURE

The MAC address value is the result of the standards implemented by the IEEE in order to guarantee unique addresses for each Ethernet device. The IEEE assigns the provider a 3-byte (24-bit) code, called “unique organization identifier (OUI)”.

The IEEE requires a provider to follow two simple rules:

  • They must use the OUI assigned to the provider as the first 3 bytes.
  • All MAC addresses with the same OUI must be assigned a unique value in the last 3 bytes.

FRAME PROCESSING

Often, the MAC address is known as " physical address (BIA) " because, historically, this address is physically recorded in the read-only memory (ROM) of the NIC. In other words, it is permanently encoded in the ROM chip.

This is how it works: When the computer starts up, the first thing the NIC does is copy the MAC address of the ROM to RAM. When a device forwards a message to an Ethernet network, it attaches the header information to the frame (which contains the source and destination MAC addresses).

MAC ADDRESS REPRESENTATIONS

MAC addresses have the following characteristics:

  • They can be represented with two points, dashes or periods, and are not case sensitive.
  • 00-60-2F-3A-07-BC, 00: 60: 2F: 3A: 07: BC, 0060.2F3A.07BC and 00-60-2f-3a-07-bc are valid representations of the same MAC address.
On a Windows host, the ipconfig / all command can be used to identify the MAC address of an Ethernet adapter

 UNICAST MAC ADDRESS

Unique address used when a frame is sent from a single transmitting device to a single receiving device. The source MAC address must always be unicast.

MAC BROADCAST ADDRESS

It is used when a frame is sent from a single transmitting device to all devices in the network.
Broadcast packets have a destination IPv4 address that contains only numbers one (1) in the host portion , meaning that all hosts on that local network (broadcast domain) will receive and process the packet. Many network protocols, such as DHCP and ARP, use broadcast.
Another feature is that when the IPv4 broadcast packet is encapsulated in the Ethernet frame, the destination MAC address is the FF-FF-FF-FF-FF-FF broadcast MAC address in hexadecimal (48 numbers one in binary).

MULTICAST MAC ADDRESS

Multicast addresses allow a source device to send a packet to a group of devices. There are some things to keep in mind:
  • The multicast MAC address is a special value that begins with 01-00-5E in hexadecimal (the remaining portion is created by converting the lower 23 bits of the IP address of the multicast group into six hexadecimal characters).
  • The range of IPv4 multicast addresses ranges from 224.0.0.0 to 239.255.255.255 .
  • The IPv6 multicast address range begins with FF00 :: / 8 .