Part 1-Networking Concepts


Hi Everyone! Today we are recalling some basic networking concepts, we don't need to go very deeply into these concepts, so we are touching the basics. So let's begin.

==============================
IP Addresses
==============================
·         Layer 3 Protocol
Layer 3 Protocol
IP Address is a sequence of number that indicates the host or network identification and location addressing , means it located that which devise has which ip address to send or receive data.
There are two types of IP Address, IPv4 and IP v6
E.g IPv4: 192.168.32.19 (inet)
It has 8 bits octet each
so a total of 32 bit = 4 bytes
an IPv4 network can have 2 raised to power 32, possible addresses

E.g IPv6 (inet6)
2 raised to power 128 but it's not yet used

so we have IPv4 and then we use NAT with IPv4 adress, means Network Address Translation, whenever there is a network, we have multiple devices attached to a single router and that router is providing us the internet, so the router has a public IP address and all other devices have a private IP address due to NAT, Nat does this job of translating the private IP address into public IP addresses whenever any devices are communicating to the internet, and also vice versa. NAT is used due to the shortage of IPv4 address,

The IP address is layer 3 protocols, layer 3 is a router
so when we route traffic, we route through an IP address




==============================
MAC Addresses
==============================
·         Layer 2 Protocol
·        MAC = Media Access Control (ether)
aka physical address

the switches communicate over this physical address so they know what device is what.
whenever we install NIC, Network Interface Card, we use MAC for it, or the cell phones that we use also have MAC, anything that is on a network will have a MAC Address

E.g ether : 00:A0:C9:14:C8:29

six pairs of two
so first three pairs are identifiers
copy and paste the first three pairs into "mac address lookup checker" https://dnschecker.org/mac-lookup.php  and it will give you the info about the switch on which the adapter is up to.
so it will give you the vendor / or company name of the adapter, giving you a Lil info.







==============================
TCP vs UDP
==============================
Layer 4 , transport layer.
here is the game of ports. means process to process communication

·         TCP

  1. connection oriented protocol
  2. transmitting control protocol
  3. 3 way handshake
  4. SYN > SYN ACK > ACK

  • TCP provides high reliability
  • hhtp/https utilizes TCP
  • ssh utilizes TCP
  • ftp (file transfer protocol) utilizes TCP

·         UDP
  1. connection-less protocol
  2. user datagram protocol
  • streaming services is connection-less that uses UDP
  • DNS is connection-less that uses UDP
  • voice over IP is connection-less used UDP

==============================
Common Ports and Protocols
==============================

TCP PORTS


FTP-21
File Transfer Protocol
we can log into the server, put a file in the server or get a file off the server

SSH-22 TELNET-23
both are for RDP, remote desktop connection, so the only difference is that telnet is clear text protocol, but ssh is encrypted

SMTP-25 POP3-110 IMAP-143
are all for InMail

DNS-53
Domain name System, resolves Domain names to IP addresses, easily readable for the humans

HTTP-80 HTTPS-443
Websites, most things are on 443
HTTP is a non-secure version of the protocol, https is encrypted, HTTP is a non-encrypted and non-secure protocol

SMB-139+445
these relate to file shares
it is so frequently open on networks
it is most common ports for pen-testers
originally its was on 139 but the latest versions of windows, they put in 445
aka samba



UDP PORTS

DNS-53
Domain name System , resolves Domain names to IP addresses , easily readable for the humans

DHCP-67,68
assigns Ip address and other network configurations parameters dynamically on a network
so when a device says your home devices connects with your home router, it assigns a random IP address and now communication can be done
it gives that  IP address to the device for a specific period of time, depending on the time set
it also gives static IP address, so from layer 2 to layer 3, MAC address and IP address are mapped each time the device is connected to the network with the same static IP address

TFTP-69
Trivial FTP 

SNMP-161
Simple Network Managment Protocol is used to monitor network devices for conditions that require the attention of an administrator



==============================
OSI Model
==============================
reminder:Layer 2-switch
               layer 3 router


there are 7 layers in the OSI Model
  • 1 P Physical layer -> data cables, cat6 cables, or something that you plugin
  • 2 D Data layer ->  switching, MAC addresses
  • 3 N Network layer -> IP Addresses, routing
  • 4 T Transport layer -> TCP, UDP
  • 5 S Session ->  Session Management
  • 6 P Presentation Layer -> WMV, JPEG, MOV files or media files
  • 7 A Application Layer -> HTTP, SMTP
  • On receiving data, it goes from layer 1-7
  • On transmitting data it goes from layer 7-1
  • If you want to Troubleshoot any issue, you go from layer 1-7

==============================
Subnetting :Part 1 Methodology
==============================
first of all
if we have an ip 10.11.0.45 and its subnet mask a 255.255.255.0
means that this belongs from class C , means that 255.255.255 are reserved but 0 is there means that we can have 254 number of hosts , means on the IP address, the last 45 can be changed only  and so in IP address, last 8 bits can be changed only

so a slash 24  is added at the end of the Mask

slash 24 depends on the no of bits that are turned on, 255.255.255.0 
bits of first three 255 are on, so one octet is of 8 bits, so 8x3=24

if we know the slash part, we will know how many hosts can be there, IP range and their broadcast addresses
so we are given with an IP and its mask
say 192.168.3.55/28
mask 255.255.255.240

we will first change all of the above bits in binary and then do an AND operation'
after and the answer will be our network address through which the router will route the traffic
say the answer is 192.168.3.0
so its very first and last IP is reserved that won't be ever used by any host
first IP is 192.168.3.0 (network number)
last IP 19.2.168.3.255(broadcast number)
so total hosts can be in b/w 1-254

==============================
Building a Network with packet tracer
==============================

After downloading the packet tracer from https://www.netacad.com/courses/packet-tracer , steps are listed below.
1)First of all , put a router , a switch beneath that router and then some home devices as we are building a home network

2)Now its time for the configuration of the router to have DHCP enables to give IP's to all the home routers


Here we trigger an enable command , which means that now we are inside the terminal of the router.
The second command we write is "show ip interface brief" , so now it is showing us the total interface of the routers
, we see that nothing is configured in the router, so the next command we give it is of :config" , so now we are inside the configuration terminal of the router

3)Now its time to give the IP address and mask.

We go to that interface , by the command "int fastEthernet 0/0",
then on the next command we give it the IP and subnet mask
and lastly we say "show IP interface brief", but here it is giving us and error, which means that show command cannot be run inside the configuration terminal

4)So for that we give it the below command to see the status of our interface.

The status is down, for that we give it a command of "no shut" means "up status" , and then we double exit to come out of the configuration terminal and at the last we "wr" command to write everything on the router

5) Once the router has its own configuration done, its time for it to enable DHCP service on it so that the home devices can get IP addresses to communicate

6)Now here

We again go to the config terminal and then we run service of DHCP on the router. After that we make a DHCP IP pool and naming it as "MAIN". Setting network IP, mask, default router and excluding the first IP of the network as it will be used by the network itself

7) Now as we are done with our router,  its time for the home devices to have their IP addresses from the above-configured router, for that we will select DHCP, for both the laptop and PC and if we then check, the devices will then have their own private IP addresses that will be showing with the devices.


8) At last, if we want an ISP above our router, we can place a router .. and also configure that as well that what will be the public IP for our home router, etc, etc

And that's it, we have built our small network by using packet tracer.

And yeah, we just recalled our networking concepts too. 






Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. tq your post is awasome.

    At this time, Around 70% of "Computer Science and Engineer" students wants to Become an Ethical Hacker. But Due to the expensive cost, Some people can't afford to pay the Ethical hacking course fee. If you desire to make your Career in Ethical Hacking, Pentestblog'll provide you the Best Ethical Hacking Course. Our Ethical Hacking Blogs are available with practical videos. This website has been designed for those people, Who aren't able to afford to pay an expensive course fee.

    Pentestblog website

    wordpress hacking

    pentestblog course

    pentestblog hacking blogs


    ReplyDelete

Post a Comment

Popular posts from this blog

P3- Basic Bash Scripting

P2- Intro to Kali Linux

P4- Stages of Ethical Hacking