Friday, 20 March 2020

TFTP


MAC ADDRESS

MAC ADDRESS: MEDIA ACCESS CONTROLLER

      It is a 48 bit hexadecimal value, assigned to a network interface controller (NIC) /

      network card / Ethernet card / Wi-Fi card.

      It is a physical address in communications within a network segment .

First 24 bits OUI (Organizationally Unique Identifier)/ Last 24 bits NIC-specific


Least Significant bit of the most significant byte

8th bit (LSB)

I/G (Individual/Group) → 0 = Unicast (one-to-one), 1 = Multicast/Broadcast

7th bit

U/L (Universal/Local) → 0 = Globally unique (from manufacturer), 1 = Locally administered (manually changed / overridden)

 

How to Find MAC address:             

            In phone - settings - About phone - detailed info/specs – status

            In system - press Windows key + R, In command prompt - Run cmd = ipconfig/all



UDP


ICMP


Traceroute


Standards and Cables


MAC Address, IP Address Range, Port numbers and Protocol numbers

MAC Address ( Media Access Control Address )
: Physical Address

Unique identifier assigned to a network interface controller (NIC) / network card / Ethernet card / Wi-Fi card is use as a network address in communications within a network segment .
Hexadecimal - 12 digit and Binary - 6-Byte -48 Bits
          
                                                                                             30-65-EC-6F-C4-58


NIC - Network Interface Controller Specific / UAA - Universally Administered Address

IG (Individual Group) bit is the least significant bit in this byte / LG (Local/Global) bit is the second least significant bit in this byte.

IP Address Range:

Public IP - WAN
  • CLASS A  0.0.0.0    - 127.255.255.255 /8
  • CLASS B 128.0.0.0 - 191.255.255.255 /16
  • CLASS C 192.0.0.0 - 223.255.255.255 /24
  • CLASS D 224.0.0.0 - 239.255.255.255 /32
  • CLASS E 240.0.0.0 - 255.255.255.255 /64
Private IP - LAN
  • CLASS A 192.168.0.0 – 192.168.255.255 /8 (65,536 IP addresses) 
  • CLASS B 172.16.0.0 – 172.31.255.255 /12 (1,048,576 IP addresses)
  • CLASS C 10.0.0.0 – 10.255.255.255 /16 (16,777,216 IP addresses)
APIPA - CLASS B 169.254.0.1–169.254.255.254 /16
(Auto Private IP Address)

Loopback - CLASS A 127.0. 0.1 – 127.255. 255.255 /8
(For checking the PC working properly)

Static IP - bought to maintain the same IP-Address always.

Unicast:     L1  Source IP      --> Destination IP
                  L2  Source PC MAC --> Destination MAC
Multicast:  L1 Source PC IP --> 224.0. 0.0 to 239.255. 255.255
                  L2 Source PC MAC --> Destination MAC
Broadcast: L1 Source PC IP --> Destination IP 255.255.255.255
                  L2 Source PC MAC --> Destination MAC FF.FF.FF.FF.FF.FF
PROTOCOL
      EXPANSION

ARP Address Resolution Protocol
RARP Reverse Address Resolution Protocol
GRAP Gratuitous Address Resolution Protocol
ADSL Asymmetric digital subscriber line 
STP Spanning Tree Protocol 
LDAP Lightweight Directory Access Protocol
LLDP Link Layer Discovery Protocol
VTP VLAN Trunking Protocol
PPP Point-to-Point Protocol
IS-IS Intermediate System to Intermediate System

PROTOCOL    EXPANSION PORT NUMBER TRNX TYPE
DNS Domain Name System  53 TCP/UDP
DHCP Dynamic Host Configuration Protocol  67,68 UDP
NTP Network Time Protocol 123 UDP
TFTP Trivial File Transfer Protocol  69 UDP
RIP Routing Information Protocol 520 UDP
ISAKMP Internet Security Association and 
  Key Management Protocol  500 UDP
SYSLOG System Logging Protocol 514 UDP
SMTP Simple Mail Transfer Protocol 25 TCP
FTP File transfer protocol 20/21 TCP
BGP Border Gateway Protocol 179 TCP
HTTP Hypertext Transfer Protocol  80 TCP
HTTPS Hypertext Transfer Protocol Secure 443 TCP
KERBEROS Cerberus 88 TCP
POP3 Post Office Protocol version 3 110 TCP
NFS Network File System 111 TCP/UDP
IMAP Internet Message Access Protocol 143 TCP/UDP
SNMP Simple Network Management Protocol 161 TCP/UDP
SNMP-TRAP traps for monitoring 162 TCP/UDP
SSH Secure Shell 22 TCP
Telnet TELecommunication NETwork 23 TCP
SFTP SSH File Transfer Protocol 22 TCP

PROTOCOL           EXPANSION PROTOCOL NUMBER
TCP Transmission Control Protocol 6
UDP User Datagram Protocol 17
ICMP Internet Control Message Protocol 1
IGMP  Internet Group Management Protocol 2
GRE Generic Routing Encapsulation 47
ESP Encapsulating Security Payload 50
AH Authentication Header  51
OSPF Open Shortest Path First  89
EIGRP Enhanced Interior Gateway Routing Protocol 88
VRRP Virtual Router Redundancy Protocol  112

OSI Layer Model and TCP/IP Model

OSI Layer (Reference Model): Open Systems Interconnection
(developed by ISO – ‘International Organization of Standardization in 1984
Interoperable communication between different vendors




















1. Physical Layer : Binary Transmission
  • It is the first of the osi model
  • It establishes a physical connection between the devices using wires and cables.
  • Eg : twisted pair and coaxial cable and optical fiber cable(SONET)
  • In which datas are transferred in the form of bits (0s,1s)
  • Functions : 
  1. Bit synchronization: data circuit-terminating equipment (DCE), data terminal equipment (DTE) using Clock signal.
  2.  Bit rate control: transmission rate i.e. the number of bits sent per second 
  3.  Physical topologies: network structure i.e. bus,star or mesh topology
  4.  Transmission mode (Data flow): Simplex,half-duplex and full-duplex.
  • Devices : Hub,repeater,Modem,Ethernet Cables,PCs,etc
  • Protocol : ADSL Asymmetric digital subscriber line, ISDN Integrated Services Digital Network, SDH Synchronous Digital Hierarchy, SONET Synchronous Optical Networking.
2. Data-Link Layer : Physical Addressing
  • The data link layer is responsible for the node to node error-free delivery over the physical layer.
  • Datas are transferred in the form of  frames.
  • Functions
  1. Flow control, Error control and Access control
  2. Data Link Layer is divided into two sub layers :
           i. Logical Link Control (LLC) - CRC checks and control error and frame synchronization
           ii. Media Access Control (MAC) - Physical Addressing and data encapsulation.
  •  Devices: Switches
  •  Protocols: ARP, RARP, GARP, PPP, STP, LLDP, VTP
      3. Network Layer : Logical Addressing
  • Logical Addressing using IPV4 and IPV6
  • Network layer converts the received segment into packets.
  • Functions:
            1.Path determination through ip routing
            2.Handles network traffic i.e network conjunction.
            3.Adds source address, destination address and sequence number to each packet.
  • Devices: Routers and L3 Switches
  • Protocols: IP, ICMP, IGMP, IPsec.
4. Transport Layer: End-To-End connection reliability
  • It is the Heart of OSI layer
  • Data is transferred in the form of segments.
  • Functions
  1. Establishes End to End Delivery of data
  2. Reliability
  3. Error control and Flow control
  4. Segmentation
  5. MUX 
  • Devices: Firewall
  • Protocols: TCP and UDP
5. Session Layer: Inter-host Communication
  • Functions:
  1. It has APIs (Application Programming Interfaces). Eg:- NetBIOS(Net Basic Input Output Systems)
  2. Session Management: For generating session ID, establishment, maintenance and termination the sessions between the client and the server
  3. Synchronization : checkpoints are added to identify the errors
  4. Dialog Controller : communication - simplex, half-duplex or full-duplex.
  5. Token management i.e preventing two parties from attempting the same critical operation simultaneously
  6. Authentication, Authorization  and Accounting.
  • Devices:  Gateways, Firewalls, PC's
  • Protocols: PPTP, SCP, SDP, SMPP, RPC, API

6. Presentation Layer: Data representation and encryption
  • Functions:
  1. Translation : ASCII to EBCDIC.
  2. Encryption/ Decryption : Data encryption translates the encrypted data(cipher text) into decrypted data (plain text) vice-versa using a key value.
  3. Compression/Decompression : Reduces the number of bits that need to be transmitted on the network vice-versa.
  • Protocols: NCP,AFP,LLP,SSL(encryption)

7. Application Layer: Network process to Application
  • Layer interacting directly with the user.
  • Functions:
  1. Network Virtual Terminal
  2. FTAM-File transfer access and management
  3. Mail Services SMTP
  4. Directory Services
  • Protocols: HTTP,DNS,FTP,DHCP

Thursday, 19 March 2020

IPV 4 and IP Header format

     IPV4 (Internet protocol Version 4)
  1. 32 bit dotted decimal value
  2. Splitted into 4 octets 
  3. Each contains 8 bits
  4. Overall 4.3 billion address are available.
  5. There are two different areas .
  • Network => Network represent area
  • Host => Host represent the users in the area 
       1st Octet plays the major role of dividing classes

         128 + 64 + 32 +16 + 8 + 4 + 2 + 1 = 255.
     
      
There are 5 classes:

Class A:  1st Octet 8th bit always 0

A 8 bit Network and 24 bit Host ( 1 octet network 1x8 = 8 and 3 octet host = 8x3 = 24)

Starts at  0.0.0.0 - 127.255.255.255 

0.0.0.0– Not for communication

127.0.0.0 – Loopback Address used by system

User Access Address 1.0.0.0 - 126.255.255.255


Subnet mask - To differentiate host bits and network bits 
                        Host bits are represented as 0 and Network bits are represented as 1


How many users can access Class A network

2^h - 2 = value    (h = number of host bits)

2^24 - 2 = 1,67,77,214  Users can access








PING Google - Packet flow


ARP Header and ARP Types

ARP (Address Resolution Protocol)
  • L2 layer protocol, it is encapsulated in Ethernet-II frame 
  • It use to resolve the L2 mac address using L3 ip address
  • Arp cache maintains a correlation between MAC and IP address.
Types of ARP:

>> RARP
>> GARP
>> Proxy ARP

RARP - Reverse ARP

Before DHCP, RARP is used. RARP provides only the IP Address, but DHCP provides ip address along with 255 parameters.

GARP - Gratuitous ARP
  • It is used to avoid IP Address conflict, where the source and target ip will be same
  • The PC will broadcast an ARP request, and checks whether the received ip address is already in use by some other PC in the network.
  • It is used in high availability protocols like VRRP (Virtual Router Redundancy Protocol)
Proxy ARP - Duplicate Gateway.

When the source and the destination are in the same network but different subnet, then the default gateway will provide its own MAC Address on behalf of the destination.


Ethernet II frame : IEEE 802.3


TCP VS UDP





TCP (Transmission Control Protocol)

UDP (User Datagram Protocol)

It is a heavy weight protocol

It is a light weight protocol

Connection-oriented (uses a 3-way handshake to establish connection, 4-way handshake to close as acknowledgement

Connectionless (no handshake)

Ensures reliable delivery of data(checks error and retransmits the lost packets)

Unreliable delivery (no retransmission)

Uses fixed windowing and sliding windowing for congestion and flow control

No flow control or congestion control

Slower due to reliability mechanisms

Fast data transmission

Segments data and ensures ordered delivery

Sends datas independently without any order.

Web browsing (HTTP/HTTPS), File transfer (FTP), Email (SMTP, IMAP, POP3)

Online gaming, Video streaming, VoIP, DNS queries


TCP


TCP (Transmission Control Protocol): protocol number- 6
  • Transport layer protocol - connection-oriented protocol
  • Responsible for reliable delivery of data
  • transmission time is relatively less
  • Uses 3 way Handshake for establishing connection and 4 way handshake for closing
  • uses Windowing - sliding window and zero window
  • protocols such as HTTP, HTTPs, FTP, SMTP, Telnet uses TCP
TCP Features:
  • Stream based flow: it ensure stream delivery of data
  • MULTIPLEXING/DEMULTIPLEXING:  Able to run multiple applications with single ip using different port numbers.
  • ERROR DETECTION: using checksum
  • LOSS DETECTION: The segment get lost and never reached the destination
  • ERROR/LOSS RECOVERY: To overcome error and loss detection . Re-transmission takes place based on the buffer size.
  • FLOW CONTROL: To ensure whether both the sender and receiver have enough buffers to accommodate the data.
  • CONGESTION CONTROL: Ensuring the network has capacity of transferring the data through the underlying layers without any trafic.
  • RELIABILITY: TCP negotiates certain parameters to make it reliable, same bit order in the destination without any packet.
TCP windowing :
  • Used to avoid congestion in the traffic.
  • It controls the amount of unacknowledged data a sender can send before it gets an acknowledgement back from the receiver that it has received it.
  • It is one of the key factors for efficient data transmission.
  • It can also be known as a form of flow control where the host indicates the sender how much data can be accepted and wait for the further instructions.


L3 Fragmentation


FTP


DNS


DHCP

DHCP Dynamic Host is a Application Layer protocol.