Skip to main content

network tut

 

tcp/ip layers

  1. Physical Layer
  2. Data Link Layer (MAC)  = ppp framing ,ethernet  IEEE 802.2 framing
  3. Network/Internet Layer(IP) = ip,icmp,arp
  4. Transport Layer(TCP/UDP)
  5. Application Layer = http/s, ntp, ssh

 

 OSI layers

  1. physical layer
  2. Data link layer : media access control (MAC) and logical link control (LLC).
  3. Network layer
  4. Transport layer
  5. Session layer
  6. Presentation layer
  7. Application layer

 https://learn.microsoft.com/en-us/windows-hardware/drivers/network/windows-network-architecture-and-the-osi-model

 

ipv4 address  length = 32 bit
ipv6 length = 128 bit

mac address length = 48 bit

example 

c:> ipconfig /all

Physical Address(mac). . . . . . . . . : B6-97-B1-6E-AB-B1

DHCP Server(ipv4) . . . . . . . . . . . : 192.168.1.254

IPv6 Address. . . . . . . . . . . : 2400:1a00:bd20:7939::3(Preferred)

 IPv6 Address. . . . . . . . . . . :  2400:1a00:bd20:7939:3436:ce31:2aa:1607(Preferred)  


port length = 16-bit integer,

Well known Ports    0 – 1023
Registered Ports    1024 – 49151
Ephemeral Ports    49152 – 65535

assined by iana ,  On Unix-like operating systems, a process must execute with superuser privileges to be able to bind a network socket to an IP address using one of the well-known ports. On most systems, registered ports can be used without superuser privileges.

c:> netstat -a 

https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

browse using ipv6 

According to RFC2732, literal IPv6 addresses should be put inside square brackets in URLs

 

[2001:4860:0:2001::68]/


dns

nslookup google.coom      
Server:  vip6-safenet-kmd01.wlink.com.np                              

Address:  2400:1a00:0:32::165                                                                                                                Non-authoritative answer:
Name:    google.com                                 
Addresses:  2404:6800:4002:82f::200e                                                142.250.193.46                                

 

 ARP stands for Address Resolution Protocol
It is used to convert an IP address to its corresponding physical address(i.e., MAC Address). 
ARP is used by the Data Link Layer to identify the MAC address of the Receiver’s machine. 

 

RARP stands for Reverse Address Resolution Protocol
As the name suggests, it provides the IP address of the device given a physical address as input. But RARP has become obsolete since the time DHCP has come into the picture. 

 

classful addressing

  • Class A
  • Class B
  • Class C
  • Class D
  • Class E

Classes D and E are reserved for multicast and experimental purposes respectively.

 IPv4 address is divided into two parts:

  • Network ID (NID)
  • Host ID (HID)

 

 

 

IP addresses are globally managed by Internet Assigned Numbers Authority(IANA) and regional Internet registries(RIR).

 

Class A

IP address belonging to class A are assigned to the networks that contain a large number of hosts.

NID=8bit HID=24 

The higher order bit of the first octet in class A is always set to 0

The default subnet mask for class A is 255.x.x.x

2^7-2= 126 network ID(Here 2 address is subtracted because 0.0.0.0 and 127.x.y.z are special address. )

2^24 – 2 = 16,777,214 host ID

 IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x

 

Class B

IP address belonging to class B are assigned to the networks that ranges from medium-sized to large-sized networks.

NID=16bit HID=16

The higher order bits of the first octet of IP addresses of class B are always set to 10

The default sub-net mask for class B is 255.255.x.x.

2^14 = 16384 network address
2^16 – 2 = 65534 host address 

IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.

 

Class C

IP address belonging to class C are assigned to small-sized networks.

NID=24bit HID=8

The higher order bits of the first octet of IP addresses of class C are always set to 110.

The default sub-net mask for class C is 255.255.255.x.

    2^21 = 2097152 network address
    2^8 – 2 = 254 host address

IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.

 

class D

The higher order bits of the first octet of IP addresses belonging to class D are always set to 1110

The remaining bits are for the address that interested hosts recognize

IP addresses belonging to class D ranges from  224.0.0.0 – 239.255.255.255

 

class E

The higher order bits of first octet of class E are always set to 1111

IP addresses of class E ranges from 240.0.0.0 – 255.255.255.254

 

special ip range

169.254.0.0 – 169.254.0.16 : Link local addresses
127.0.0.0 – 127.0.0.8 : Loop-back addresses
0.0.0.0 – 0.0.0.8 : used to communicate within the current network.

 

host id rules

all 0  host ID is used to represent the network ID of the IP address

all 1 host ID is reserved as a broadcast address to send packets to all the hosts present on that particular network.

the host ID must be unique to the network

 

network id rules

 The network ID cannot start with 127 because 127 belongs to class A address and is reserved for internal loop-back functions.

all 1 is reserved for  IP broadcast address

all 0 denote a specific host on the local network and are not routed

 

summary 


 

 src:

https://en.wikipedia.org/wiki/Classful_network

 

 ipv4 header

VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4

HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. The minimum value for this field is 5 and the maximum is 15.

Type of service: Low Delay, High Throughput, Reliability (8 bits)

Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and the maximum is 65,535 bytes.

Identification: Unique Packet Id for identifying the group of fragments of a single IP datagram (16 bits)

Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more fragments flag (same order)

Fragment Offset: Represents the number of Data Bytes ahead of the particular fragment in the particular Datagram. Specified in terms of number of 8 bytes, which has the maximum value of 65,528 bytes.

Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop through the network by restricting the number of Hops taken by a Packet before delivering to the Destination.

Protocol: Name of the protocol to which the data is to be passed (8 bits)

Header Checksum: 16 bits header checksum for checking errors in the datagram header

Source IP address: 32 bits IP address of the sender

Destination IP address: 32 bits IP address of the receiver

Option: Optional information such as source route, record route. Used by the Network administrator to check whether a path is working or not.

Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

xbps-install  sxhkd ------------ mkdir .config/sxhkd cd .config/sxhkd nano/vim sxhkdrc -------------------------------- XF86AudioRaiseVolume         amixer -c 1 -- sset Master 2db+ XF86AudioLowerVolume         amixer -c 1 -- sset Master 2db- XF86AudioMute         amixer -c 1 -- sset Master toggle alt + shift + Escape         pkill -USR1 -x sxhkd XF86MonBrightnessUp          xbacklight -inc 20 XF86MonBrightnessDown          xbacklight -dec 20 ------------------------------------------------------------- amixer -c card_no -- sset Interface volume run alsamixer to find card no and interface names xbps-install -S git git clone https://git.suckless.org/dwm xbps-install -S base-devel libX11-devel libXft-devel libXinerama-devel  vim config.mk # FREETYPEINC = ${X11INC}/freetype2 #comment for non-bsd make clean install   cp config.def.h config.h vim config.h xbps-install -S font-symbola #for emoji on statusbar support     void audio config xbps-i

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you

download office 2021 and activate

get office from here  https://tb.rg-adguard.net/public.php open powershell as admin (win+x and a ) type cmd  goto insall dir 1.         cd /d %ProgramFiles(x86)%\Microsoft Office\Office16 2.           cd /d %ProgramFiles%\Microsoft Office\Office16 try 1 or 2 depending on installation  install volume license  for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x" activate using kms cscript ospp.vbs /setprt:1688 cscript ospp.vbs /unpkey:6F7TH >nul cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH cscript ospp.vbs /sethst:s8.uk.to cscript ospp.vbs /act Automatic script (windefender may block it) ------------------------------------------------------------------------------------------------------------------- @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&