void boundary_fill(int x, int y, int fcolor, int bcolor)
if (getpixel(x, y) != fcolor) & (getpixel(x, y) != bcolor) cfw_
putpixel(x, y, fcolor);
boundary_fill(x + 1, y, fcolor, bcolor);
Delays in Computer networks
Transmission delay of a packet is the time taken to transfer the packet onto the
T d = Length of packet / Bandwidth
Problem: If length of the packet is 1Kbytes and Bandwidth is 1kbps( 1000 bps)
Combining many small networks into one big network is called summarization or
Rules of supernetting: All the IP addresses should be contiguous.
Size of all the networks should be power of 2.
All the networks sh
Classless Interdomain Routing (CIDR)
Rules for CIDR blocking: All the IP addresses in a block should be contiguous.
Number of IP addresses in a block or size of the block should be a power of 2.
The starting address (first) in the block should be evenly
Variable length subnet mask
In variable length subnet masking, a network is divided into variable size
For example: A university has a block of class C IP addresses starting with 22.214.171.124.
These IP addresses need to be distributed among three dep
It is a 32-bit number in which number of 1s indicates Network Id + Subnet Id
(SID) part and number of 0s indicates the host id part.
If we bitwise AND any IP Address I with subnet mask then we get network
id or subnet id to which I belongs to.
Types of Casting in Computer Networks
In unicast, packet is sent from a source to a particular destination.
SIP: Source IP Address
DIP: Destination IP Address
It is of two types:
Types of Addresses in Computer Networks
Logical Address: A number, which can identify any system in the world
uniquely, is called logical address.
Physical Address: A number, which can uniquely identify any system within a
network, is called physical addr
It is of two types:
2.Classless Addressing (CIDR)
Class full Addressing
Distribution of IPv4 Addresses
Class A (Starts with 0)
Class B (Starts with 10)
Class C (Starts with 110)
Class D (Starts with 1110)
Class E (St
Problems in Computer Networks
These kinds of problems can be solved by protocols like ftp, smtp etc.
Protocols are set of rules that discuss about the following
int main( )
printf("Enter the value of x1 : ");
printf("Enter the value of y1 : ");
printf("Enter the va
void plotpoints(int x, int y, int cx, int cy)
putpixel(cx + x, cy + y, 4);
putpixel(cx - x, cy + y, 4);
putpixel(cx + x, cy - y, 4);
putpixel(cx - x, cy - y, 4);
putpixel(cx + y, cy + x
void flood_fill(int x, int y, int ncolor, int ocolor)
if (getpixel(x, y) = ocolor) cfw_
putpixel(x, y, ncolor);
flood_fill(x + 1, y, ncolor, ocolor);
flood_fill(x + 1, y - 1, ncolor, oco
# include <stdio.h>
# include <conio.h>
# include <graphics.h>
printf("\n\n\tEnter the co-ordinates of first point : ");
printf("\n\n\tEnter the co-ordinate
Ethernet (IEEE 802.3)
Characteristics of Ethernet: a. Topology used is bus
b. Access control method is CSMA/CD.
c. Data rates are 10 mbps, 100 mbps, and 1 Gbps
d. Collisions are possible.
e. Encoding used is Manchester.
f. There is no acknowledgement.