# data[].attributes.body
OSI and TCP/IP models
Application layer is the layer that provides interface the layer protocols are used to exchange data between running programs and destination hosts.
TCP/IP protocols fits roughly to the three lyers of the OSI model that are application , presentation , ad session layer.
1. presentation layer

coding and conversion data to ensure that data from device can be interpreted by the appropriate on the destination device.

compression and it can be decompressed by the destination

device encryption and decryption upon receipt by the destination

2. session layer
it is responsible for
setting up , managing and tearing down the session between presentation layer entities.
it coordinates communication between systems by offering three mods simplex , half duplex and full duplex
the sum up this layer just keep applications data separate from other applications.
-----------------------------------------------------------------
application , services & protocol
applications : are use by people to communicate over network
services : are the programs that interface with networks and prepare data to transfer
each application or network uses protocol which are the rules.
the device that requesting info is the client and the responding to the request is the server.
TCP/IP protocols
1_ Domain Name  DNS used to change names to ip address
2_ Telnet used to provide remote access
3_FTP is used to transfer data between systems.
in peer to peer model devices  can share data with out having a  dedicated server
ever end device  can be client pr server .
server to client is download
client to server is upload
port number associate with services like UDP and TCP .
some port numbers
DNS - TCP/UPD port 53
HTTP - TCP port 80
telnet - TCP - port 23
DHCP - UDP port 67
FTP - TCP ports 2- and 21
UDP = user datagram protocol
TCP = transmission control protocol
Telnet : can be define as service protocol also it used to access remotely devices
telnet security is low but if you want high security you need to use SSH Secure Shell it same as telnet use better security it uses encryption
DNS : i data networks it is labeled with numeric IP addresses . people can not remember all those hard IP address so they changed it easy names by DNS
FTP:is for transfer data between client and server . FTP needs 2 connection one is for the control traffic port 21
and the other is for the file transfer and it is port 20
DHCP: it gives automatic IP address subnet masks default getway to the devices it uses in large local networks
is is not assigned it is just for a period of time .

# data[].attributes.body
Network means to share data between tow devices or more  .
it makes work easier and faster
there are for network elements
1_Rules 2_Medium 3_Messages 4_devices
End user:  are the ones who use the data and send the data
Intermediary devices:is for to send data from source to destination
medium work as connection from source to destination
rules sets of instruction tells how the data should send .
local area networks (NAT) is for a single area that provides server
Wide Area Network (WAN) is for separated locations like internet

# data[].attributes.body
logical topology is what how the data transfers .
every connection has a rule and it is Network Protocol.
to preform a network communication a group of inter related protocols are required and is is called protocol suit .
network protocol describe the format of the message and how and when the error has passed .
the standard of protocol is (IEEE) institute of electrical and electronics engineers.
there are 2 layered models 1_protocol models 2_reference models
the purpose of references model is to understand the functions and process involved  the most known is (OSI)
protocol model represents how to interface with human network.
like  the TCP/IP .
TCP/ is implemented on both sending and receiving hosts
how TCP works
1.creation 2.segmentation and encapsulation 3. generation 4. transportation 5.reception 6.de-capsulation and reassembly 7. passing data to destination application.
layer 2 is the and device is called MAC address Media Access Control
layer 3 designed to move data from source to destination
the address called IP .
layer 3 uses the network identifier portion to decide which path takes to the host
layer 4  application or services are port numbers
the port and source are representative of tow communication applications .

# data[].attributes.body
Network accessing device are 4
1.Repeater receives digital and regenerate it  , 2.Hub is a multiple port
limitation of those tow
works only on PHY layer
if data send at the same time collision will occur
3.Bridge is a data link layer segments by examining destination mac address
4.switch it is just a multiple port bridge
why we use switch and bridge
dedicated bandwidth to each port
collision free environment
full duplex operation
switch operations
1. learning look at the mac address
2. aging deleting the values that reach 0
3.flooding switch will send the data to all ports
4. selective forwarding
5. filtering won't send data to the port that came from .
Router: is the getaway to the other network you need to identify the IP
the hosts will recognize the getaway
routing is a process that you forward a packet to a destination network .
routing table: store the connection data
router operation
1.forward it to the next hop router
2.forward it to the destination host
3.drop it

# data[].attributes.body
2 address types
public address: can be accessible from the internet. you can change private to public by using NAT (NETWORK ADDRESS TRANSLATION)
Private Address
there are 3 ranges of private Address
10.0.0.0 to 10.255.255.255 prefix 8
172.16.0.0 to 172.31.255.255 prefix 12
192.168.1.1 to 192.168.255.255/16
the prefix address is for network address
and the others are for broadcast address.
we have 3 classes of IP address
class A for very large networks support
16M host address and 128 possible networks prefix/8 (0.0.0.0 to 127.0.0.0)
class B for moderate to large supports 65000 hosts and 16000 possible networks prefix /16 ( 128.0.0.0 to 191.255.0.0)
class C for small networks max hosts 254    it could provide address for 2M networks prefix/24 (192.0.0.0 to 223.255.255.0)
we have static address : in this we need to write every address on the devices by our self it is useful for small group and printers servers
dynamic address : it gives automatic address to the devices by The (DHCP) Method.

# data[].attributes.body
SUBNETTING creating multiple networks from 1 address
to do this you going to get an private address like 192.168.1.0/24
change the host portion to binary
if you want to divide it into 2 networks you need (1) if 4 (2)if eight (3) plus it with prefix 24+1=25
change the first value (left to right)

00000000 you will dived it into 2 networks so we have 2 deferent values(1 and 0) get the network address and the broad cast address with both  values

00000000             192.168.1.0/25
01111111              192.168.1.127/25
10000000                  192.168.1.128/25
11111111                  192.168.1.255/25

if you wanted 4 networks you will works with first 2 ones
00000000
subnet a subnet
192.168.1.127/25
just like the old one but this time the first tow values are untouchable
10  000000 do the same as before

# data[].attributes.body
The NIC card is a shortcut for Network Interface Card that provides Physical connection for computers it can be set up on PCI slot on motherboard.
physical port is where the device connected to the network .
there are transmission mediums that can  share the network .
there are bounded/guided media that is wire  and unbounded /unguided media that is like WIFI
there are 2 types of UTP cable
Unshielded: there is only a copper cover
shielded there foil shield for each 2 pairs
you can create RJ connectors with UTP cables that  like RJ-45 that uses to share network.
to connect 2 different devices you need to use (straight) like  hub to pc
to connect same kind of devices you need to use (crossover) like pc to router
TX can be connected to RX
and RX to TX
there are 2 types of network topology each of them have their advantages and disadvantages depends on where you use it
physical topology
1- ring topology 2-star topology 3-mesh topology 4-tree topology
logical topology

# data[].attributes.body
IP Address at network layer 3 this packet need to be identify with source destination of the tow end devices with IPv4 IP is 32 bit
IP is Decimal number but The Devices read Binary so it can be changed to binary too
IP address Network and host portion
the high order bit represents the network portion the lower order bit represents host portion the number of bits shows how many host we can have
all 32 bits define IPv4
we have 3 types of Address
Network Address :  it refers to a network we can find it by making all host portion bits to 0
Broadcast Address :  send data to all hosts in a network you can find it by  changing all portions to 1
Host Address : we assign the values between the network address and the broadcast address .
Network Prefixes
prefix is the number of the bits that represent the network portion
like 172.16.4.0/24  24 is prefix
the first 24 bits is the network portion
the other 8 bits is for the host portion
Subnet Mask  provides the same info as prefix while prefix is like this
172.16.4.0/24 subnet mask is like this
255.255.255.0  the first 24 bit is for the network
Types of communication  there are 3 types
1.Unicats: sesning a packet from one host to a individual host
2.Broad Cast Traffic :  it uses to send all packs to all hosts in the network it uses special broadcast address
3.Mulaticast: sends a single packs to a selected set of hosts