Java Tutorial Index

Java Tutorial Java Features C++ vs Java Java History Java Hello World Java Development Kit Java Runtime Environment Java Virtual Machine Difference between JDK, JRE, and JVM Memory Areas in Java Java Operators Java Keywords Primitive Data Types Variables

Java Loops

Java Do While Loop Java While Loop Java For Loop Java Enhanced For Loop

Java Programs

Java Basic Programs Factorial Program in Java Fibonacci Series Program in Java Prime Number Program in Java Palindrome Number Program in Java Armstrong Number Program in Java Anagram Program in Java Pattern Programs in Java Calculator Program in Java Leap Year Program in Java Addition Program in Java Number Pattern Programs in Java Star Pattern Programs in Java Package Program in Java Pyramid Program in Java Sorting Program in Java String Palindrome Program in Java Even Odd Program in Java For Loop Program in Java If Else Program in Java Switch Case Program in Java GCD Program in Java LCM Program in Java Hello Program in Java Matrix Program in Java Menu Driven Program in Java Series Program in Java Client Server Program in Java Swapping Program in Java Pig Latin Program in Java Tower of Hanoi Program in Java Recursion Program in Java Matrix Multiplication Program in Java Perfect Number Program in Java Classes and Objects in Java Example Programs String Programs in Java Array Programs in Java Constructor Program in Java Inheritance Program in Java Abstract class Program in Java Interface Program in Java Encapsulation Program in Java Polymorphism Program in Java Exception Handling Program in Java Multithreading Program in Java Thread Program in Java Collection Programs in Java ArrayList Program in Java Stack Program in Java Applet Program in Java Swing Program in Java JDBC Program in Java How to run Java program in command prompt How to run Java program in Eclipse Program to find and replace characters on string in java Program to find the duplicate characters in a string Program to check whether a given character is present in a string or not Java Program to Print Permutations of String Java program to find frequency of characters in a string Java Program to remove duplicate characters in a string

Java Sorting

Sorting Algorithms in Java Merge Sort in Java Quick Sort in Java Bubble Sort in Java Insertion Sort in Java Selection Sort in Java Heap Sort in Java Radix Sort in Java Topological Sort in Java Bucket Sort in Java Counting Sort in Java

Java OOPs Concepts

OOPs - Object Oriented Programming Objects and Classes in Java Methods in Java Java Naming Conventions Constructors in Java Java this keyword Java static keyword Inheritance in Java Aggregation in Java Java super keyword Constructor Chaining and Constructor Overloading Java Polymorphism Static and Dynamic Binding in Java Java Abstraction Abstract class in Java Interface in Java Difference between Abstract class and Interface Java final keyword Packages in Java Access Modifiers in Java Java Wrapper classes Java Numbers Java Characters Java Integer Java Boolean Java Arrays Java Command Line Arguments Java strictfp Keyword Java Math

Java Strings

Java Strings Java String Methods StringBuilder in Java StringBuffer in Java Java Regular Expressions StringBuffer vs StringBuilder String vs StringBuffer String vs StringBuilder String Manipulation in Java Java String Concatenation How to Reverse a String in Java String Array in Java How to Compare Two Strings in Java How to Concatenate Two Strings in Java Why String in Immutable in Java java.lang.NumberFormatException for Input String String Pool in Java Java Generate Random String How to take String Input in Java Java String Interview Questions

Java Exceptions

Exception Handling in Java Java try catch Java throw Java throws Difference between throw and throws Java finally Java Custom Exception Java Exception Propagation

Garbage Collection

Automatic Resource Management in Java Java Garbage Collection Java finalize() Java gc() Difference between final, finally and finalize

Multithreading

Multithreading in Java Process and Thread in Java Basic Terms in Multithreading Java Thread creation Thread Scheduler in Java Java Thread class DeadLock in Java

Java IO

Java IO Java Read File Java file Reader Java Buffer Reader Java file Writer Java BufferedWriter Java InputStreamReader Scanner in Java Java StringReader Java StringReader Class Java StringWriter Class Java PrintWriter Java File Java Read File Line By Line Java FileInputStream Java FileOutputStream Java Create File Java Delete File Java Open File Java Read File to String Java copy file Jar File in Java Java FileNotFoundException

Serialization

Java Serialization Java transient

Networking

Java Network Programming Java Socket Programming Java URL Java URLConnection HttpURLConnection in Java Java InetAddress Java DatagramSocket and Java DatagramPacket

AWT

Java AWT

Swing

Swing in Java

Java Collections

Collections in Java Java List Interface ArrayList in Java LinkedList in Java Vector in Java Stack in Java ArrayList vs LinkedList in Java ArrayList vs Vector in Java Java Set Interface HashSet in Java LinkedHashSet in Java TreeSet in Java Java Queue Interface PriorityQueue in Java Deque in Java ArrayDeque in Java Java Map Interface HashMap in Java LinkedHashMap in Java TreeMap in Java Dictionary in Java Hashtable in Java Properties in Java Collections class in Java Java Comparable Java Comparator Comparable vs Comparator in Java

Java Generics

Generics in Java

Java Annotations

Annotations in Java

Java JDBC

Java JDBC Tutorial JDBC Architecture Types of JDBC Drivers JDBC vs ODBC Java Database Connectivity with MySQL Java Database Connectivity with Oracle Statements in java Prepared statement in Java Resultset in java Java ResultSetMetaData DatabaseMetaData in Java Callable Statement in Java Transaction Management in Java Design of JDBC

Java Differences

Java vs DotNET Java vs JavaScript Python vs Java Kotlin vs Java Java vs C++ C# vs Java Java float vs double Java vs Scala Java vs Go Java vs Golang Java Extends vs Implements Java vs Node.js Static vs Non-static in Java C vs Java int vs Integer in Java Java protected vs private Java vs Dot Net Stack vs Heap in Java Java Array vs ArrayList Java SE vs EE Class vs Object in Java Java vs Bedrock Difference between = = and equals ( ) in java Difference between C, C++, java HashMap Vs HashTable Checked vs Unchecked Exceptions in Java Difference between print() and println() in Java Differences between Lock and Monitor in Java Concurrency Differences between Set and List in Java How to calculate time difference in Java Char and String differences in Java Difference between String, StringBuffer and StringBuilder in java Difference between String and Char Array in Java Differences between Byte Code and Machine Code Difference between String Tokenizer and split Method in Java Difference between JIT and JVM in Java Difference Between Data Hiding and Abstraction in Java Difference between String Tokenizer and Split Method in Java Difference Between BufferedReader and FileReader Difference Between Thread.start() and Thread.run()

How to

How to convert String to String array in Java How to find length of integer in Java How to get Day Name from Date in Java How to open the Java control panel How to resolve Illegal state exceptions in Java How to reverse a linked list in java How to encrypt password in Java How to calculate time complexity of any program in Java How to check version of java in Linux How to enable java in chrome How to run Java program How to set path in Java How to check the Java version in cmd How to install Java in Windows 10 How to run Java program in cmd How to add double quotes in a string in Java How to convert list to String in Java How to call a method in Java How to Set Environment Variables for Java How to sort an array in Java How to Create Immutable Classes in Java How to iterate HashMap in Java How to write Java program How to create an array in Java How to create a package in Java How to generate random numbers in Java How to input String in Java How to Create Singleton Class in Java How to create thread in Java How to find length of String in Java How to sort a string in Java How to use scanner in Java How to achieve multiple inheritance in Java How to find the length of an Array in Java How to Read Java JSON file How to run Java program in Eclipse How to call a function in Java How to create array of objects in Java How to create custom exception in Java How to import packages in Java How to run applet Program in Java How to take Array Input in Java How to achieve abstraction in Java How to call static method in Java How to compare characters in Java How to compare dates in Java How to create a linked list in Java How to download Eclipse for Java How to get ASCII value of char in Java How to get the current date and time in Java How to handle NullPointerException in Java How to initialize string array in Java How to Install Java on MAC How to run java program in ubuntu How to find characters with the maximum number of times in a string java How to Set Java_home in Linux How to Split the String in Java with Delimiter How to take Multiple String Input in Java using Scanner class How to uninstall the Java in Ubuntu How to Update Java How to add Elements in Array in Java How to avoid deadlock in java How to Split String by Comma in Java How to remove special characters from String in Java How to remove last character from String in Java How to Read XML Files in Java How to download and install Eclipse in Windows How to Create an API in Java How to Round Double Float up to Two Decimal Places in Java How to create a mirror image of a 2D array in Java How to set timer in Java

Java 8 Features

Java 8 Features Lambda Expressions in Java Functional Interface in Java Streams in Java Java Base64 Encoding and Decoding Type Annotations in Java Java Stringjoiner Class Parallel Arrays Sort in Java Bifunction in java 8 Java 8 filters list Java 8 Consumer Interface in Java

Java 9 Features

Java 9 Tutorial Java 9 Try With Resources Java 9 Interface Private Method

Java 12

What’s new in Java 12

Java 13

Java 13 New Features

Java 14

New Features of Java 14

Java 15

What’s New in Java 15

Java 16

Java 16

Java 17

What is new in Java 17

Java Servlet Tutorial

Java Servlets Tutorial

Java JSP Tutorial

Java JSP Tutorial

Hiberate Tutorial

Hibernate Tutorial

Spring Tutorial

Spring Tutorial

Spring MVC Tutorial

Spring MVC Tutorial

Jenkins Tutorial

Jenkins Tutorial Jenkins java net socket connection time out

Java Math Methods

Math.abs() Math.acos() Math.addExact() Math.asin() Math.atan () Math.atan2() Math.cbrt() Math.ceil() Math.copysign() Math.cos() Math.cosh() Math.decrementExact() Math.exp() Math.expm1() Math.floor() Math.floorDiv() Math.floorMod() Math.fma() Math.getExponent() Math.hypot() Math.IEEEremainder() Math.incrementExact() Math.log() Math.log10() Math.log1p() Math.max() Math.min() Math.multiplyExact() Math.multiplyFull() Math.negateExact() Math.nextAfter() Math.nextDown() Math.nextUp() Math.pow() Math.random() Math.rint() Math.round() Math.scalb() Math.signum() Math.sin() Math.sinh() Math.sqrt() Math.subtractExact() Math.tan() Math.tanh() Math.toDegrees() Math.toIntExact() Math.toRadians() Math.ulp()

Java String Methods

toCharArray() copyValueOf() endsWith() equals() equalsIgnoreCase() format() getBytes() getChars() hashCode() indexOf() intern() isEmpty() join() lastIndexOf() length() replace() replaceAll() replaceFirst() split() startsWith() subSequence() substring() toLowerCase() toUpperCase() trim() valueOf()

Java Conversion

Java Convert String to int Java Convert int to String Java Convert String to long Java Convert long to String Java Convert String to float Java Convert float to String Java Convert String to double Java Convert double to String Java Convert String to Date Java Convert Date to String Java Convert String to Object Java Convert Object to String Java Convert String to char Java Convert char to String Java Convert int to long Java Convert long to int

Misc

List all files in a Directory in Java Nonagonal number in Java Null Pointer Exception in Java Package naming convention in Java Packages Program in java Pangram Program in Java PriorityBlockingQueue Class in Java Race Condition in Java Repdigit Numbers in Java Reserved Keywords in Java Rotate matrix by 90 degrees in Java Segment Tree in Java Sierpinski Number in Java Sort Dates in Java Thread Safety and How to Achieve it in Java Normal and Trace of a Matrix in Java Transient variable in Java Tribonacci series in Java Web Crawler in Java Zigzag Traversal of Binary Tree in Java Java Full Stack Java IO filenotfoundexception Java Output Formatting Java Plot Java Pop Java program to print matrix in Z form Java Set to List Java Switch string Java Thread Lifecycle: States and Stages Java Viva Questions and Answers Lazy Propagation in Segment Tree in Java Level order Traversal of a Binary Tree in Java Method chaining in Java Narcissistic Number in Java Java Case Keyword Java Try-Catch Block Java Class KeywordJava concurrency interview questions Java Continue Keyword Java CountDownLatch Java Default Keyword Java Double Keyword Java Editors Java Else Keyword Java Enum Keyword Java Extends keywordJava Finally Keyword Java Font Example of Static import in Java How Many Ways to Create Objects in Java Implementing Queue Using Array in Java Instanceof operator in Java Interchange Diagonal elements in Java Java Arrays Fill Java Char Keyword Convert list to array Java Convert milliseconds to date in Java Copy data/content from one file to another in java CRC Program in Java Creating a Jar file in Java Crown Pattern in Java Difference Between Access Specifiers and Modifiers in Java Difference Between Java and PHP Difference Between replace() and replaceall() in Java Duodecimal in Java Finding middle node of a linked list in Java Group by in Java 8 Hollow Diamond Pattern in Java How annotations work in Java Java Boyer Moore Catalan number in Java Cosmic Superclass in Java Difference between this and super in Java Fall through in Java Figurate Number in Java Java Anon Proxy Java RMI Lazy loading in Java Magnanimous Number in java Shallow copy in Java String to JSON in Java Tetranacci Number in Java Vigesimal in Java Why main method is static in Java Add Time in Java Bellman Ford Algorithm in Java Best Java Libraries Blockchain in Java Blocking Queue in Java Example Bully Algorithm code in Java Contextual keywords in Java Convert JSON File to String in Java Determine the Upper Bound of a Two-Dimensional Array in Java Java.net.ConnectionException Java.net.SocketException Web Service Response Time Calculation in Java Functional Interfaces in Java Singleton class in Java Awesome explanation of Strings in Java Object class in Java Static class in Java All the important string methods in Java String Handling Method in Java What are Array strings in Java Advantages and Disadvantages of Strings in Java Big Decimal class in Java Class definition in Java Replace character in string Java String Coding Interview Questions in Java What is String in Java? String isnullorempty in Java String Matches in Java Trim Method in String Java Bean class in Java Libraries in Java Arithmetic Operations on String in Java Convert Char array to string in java Check whether Java is installed or not How to stop execution after a certain time in Java Jagged Array in Java Java ArraylistRemove() Time Complexity Java Swing Time Picker Zigzag Array in Java Array and String based questions in Java Array and String with Examples in Java Best Practices to use String Class in Java What is string in Java why it's immutable Java String Java String Inbuilt functions Java String Matches vs Contains Sum of digits in string in java Check the presence of Substring in a String in java Java import packages Interfaces and Classes in Strings in Java Maximum length of string in java Hidden classes in Java Class memory in Java public static void main string args meaning in java Reverse a String in Java String Concatenation in Java Buffer reader to read string in Java Split String into String Array in Java Reverse a String using Collections in Java Upcasting and Downcasting in Java String Declaration in Java Method Overloading In Java Java Solid Principles Java Architecture Binary Search Java Star Program in Java Java Type Casting Java Pass-by-Reference Java Framework List Java Destructors Java Control Statements Java Byte Code Java Beans Java Identifiers Character Array in Java Java Applications Java Substring Java Session Non-primitive data types in Java Matrix Multiplication in Java JIT in Java Java Tokens Java Externalization Default Virtual Behaviour in C++ vs Java Why we use static in Java Session Tracking in Java Knapsack problem in Java Java Logo Java exception list Java Iterator Java instance variable Frugal number in Java Fork Join in Java Date time API in java Compile time vs Runtime in java Compare time in java AES 256 Encryption in Java Advanced Java skills What is advance Java? User Defined Exception in Java Upcasting in Java Tree Implementation in Java Special Operators in Java Reentrant Lock in Java Perfect Number in Java Java logger Java LinkedList vs ArrayList File Operation in Java Constructor Overloading in Java Conditional operator in Java Concurrent Linked Deque in Java with Examples Command Class in Java Java Break Keyword Best Java IDE Association in Java Access specifiers in Java AbstractSet Class in Java Adapter class in Java Composition in Java Mutable and Immutable in Java Static() Function in Java Traverse through HashMap in Java Vectors in Java Creation of Multi Thread in java Java Enumeration Compile-time Error in Java Java Get Time in UTC Java.sql.Time Format Structure of Java Program Thread Concept in Java Creation of Multi-Thread in Java Enterprise Java Beans POJO in Java Volatile keyword in Java Java Constant Collection Interfaces in Java with Examples Deadlock Prevention and avoidance in Java Java Boolean Keyword Java Byte Keyword Java List Implementations Java Xml Parser Method Overriding in Java RMI program in Java Virtual Function in Java What is interpreter in Java? Advanced Java Viva Questions Application of Array in Java Economical number in Java Iterate JSON array in Java Java callable example Java Command not found Java Date add Days Java File Extension Java Location Java Trim User Defined Custom Exceptions in Java Java array list remove time complexity Java.lang.Exception.NoRunnableMethods Java Map Example Java Obfuscator Java Pi Java Queue Java time local date Java Xmx Uses of Java Applet Life Cycle in Java Best Java Security Framework BigDecimal toString() in Java Jdoodle Java Literals in Java MVC in Java Powerful Number in Java Read the XLSX file in Java Relatively Prime in Java Root exception in java What is anagram in Java? Accessors and Mutator in Java Bottom view of a binary tree in Java Convert List to String in Java Equidigital in Java How to check data type in Java IdentityHashMap in Java Java Clone Array Java LDAP Authentication Java List Node Java Password Generator Magic Square in Java Pancake Sorting in Java Practical Number in Java Sublime Number in Java Sudoku in Java Compare Two Times in Java Diffie Hellman Algorithm in Java How to Reduce Time Complexity in Java Java calculate age Map of Map in Java Minimum XOR value pair in Java Palindrome Partitioning problem in Java Pernicious Number in Java Prime Points in Java Rectangular Numbers in Java Sleep Time in Java The final Keyword in Java Types of Statements in Java Unicode System in Java Zig Zag star and Number Pattern in Java Balanced Prime Number in Java ConcurrentSkipListSet in Java Construct the Largest Number from the Given Array in Java CopyOnWriteArrayList in Java Cyclic Barrier in Java Dangling Else problem in Java Display Unique Rows in a Binary Matrix in Java Empty Statement in Java Factorial of a Large Number in Java Facts about null in Java Rehashing in Java Singleton Design Pattern in Java Zebra Puzzle Problem in Java XOR of Array Elements Except Itself in Java Types of Sockets in Java Thread Synchronization in Java Set Up the Environment in Java Method and Block Synchronization in Java Fibodiv Number in Java House Numbers in Java GCD of Different SubSequences in Java Hogben Numbers in Java Decagonal Numbers in Java Converting Roman to Integer Numerals in java Check if the given array is mirror inverse in Java Caesar Cipher Program in Java Block Swap Algorithm for array rotation in Java Java Binary Tree Binary Strings Without Consecutive Ones in Java Beautiful Array in Java Balanced Parentheses in Java Arithmetic exception in Java Add numbers represented by Linked Lists in Java Two Decimal Places Java Intersection Point of two linked list in Java Find next greater number with same set of digits in Java Getter and Setter Method in Java Example Java Binary to Hexadecimal Java Calculate Average of List Iccanobif Numbers in Java Java delete directory Java For Keyword Java Float Keyword Java Instanceof Keyword Java If Keyword Java Int Keyword Java Import Keyword Java Package Keyword Java Static Keyword Java Public Keyword Java Implements Keyword Java Private keyword Java Protected Keyword Java Short Keyword Java Long Keyword Java Interface Keyword Java Try Keyword Java New Keyword Java Return Keyword Tug of War in Java Types of Events in Java

Java Networking

Networking

Networking is a way of communicating the devices. It is made up of various technologies like computers, switches, routers that are interconnected and share data among themselves.

The two common network protocols:

1. TCP/IP

TCP stands for Transmission Control Protocol/Internet Protocol that allows reliable communication between two applications. TCP/IP specifies data exchange over the end-to-end communications and specify how it should be broken, transmitted, routed, packets, addressed, and received at the destination. TCP/IP is compatible with all the operating systems. TCP/IP is a highly scalable and routable protocol that searches the most efficient path through the network. The two main protocols in TCP/IP protocol suite serve specific functions:

  • TCP: The application can create channels of communication across the network. It also manages how messages are assembled into smaller packets and then transmit it over the Internet and re-assembled in the right order at the destination address.
  • IP: It defines how to address and route each packet to make sure it reaches the right destination.

2. UDP

UDP stands for User Datagram Protocol, a connectionless protocol that allows the packets of data to be transmitted between the applications. It is an unreliable and connectionless protocol, so there is no need to establish a connection before transferring the data. UDP permits packets drops instead of processing delayed packets. There is no error checking in UDP. UDP is more efficient, based on both latency and bandwidth. It is useful when it reduces the requirement of computer resources, the transmission of Real-time packets, mainly in multimedia applications. It is used for simple request-response communication when the size of data is less. It is a suitable protocol for multicasting as UDP supports packet switching. UDP is used for routing some update protocols. It is usually used for real-time applications that cannot tolerate uneven delays between sections of a received message.

Networking has the following modules, such as:

  1. Clients and Servers.
  2. IP Addresses.
  3. A network hub, switches, and cables.
  4. Routers and firewalls.

Client and Server concept

It is an essential architecture to communicate with each other over the network.

Server

  1. The server is the computer that holds services and every single information related to the clients such as media files, database-related matters, and keep the website for Google search page, etc.
  2. It provides services in the form of webpages and sends it out when requested by the client.

Client

  1. The client is a different computer that requests to view, download, or search the content from the server, such as to request for Google web page, etc.
  2. A client connects to the server and other clients over a network to exchange the information and data.
Client and Server concept

Mechanism of a working client-server architecture

In a client-server architecture, the client computer sends a request for data to the server, the server accepts the request of the client, process it, and deliver the data packets requested back to the client. One unique feature is that the server computer has the potential to manage numerous at the same time.

On the network, the server can locate anywhere, and if the client has its IP Address, it can access its services efficiently. The client asks for the services like website accessed from the server computer. The respective site is delivered through the server and displayed on the client web browser in the form of webpages.

IP Address

It is a unique address to identify the computer on the network. It is used for directing the data across a network, computers need to identify their destinations and origins. It is an identification which is known as IP Address.

Two types of IP Address:

  1. IPv4
  2. IPv6

IPv4 address

The IPv4 protocol is assigned for 232 addresses. Addresses in IPv4 is 32-bits long. There is a maximum of 4,294,967,296 unique addresses. IPv4 is 32- bit binary number that contains two sub-addresses i.e., the network and the host, with an imaginary boundary separating them. An IP address is represented as 4 octets of numbers from 0-255 represented in decimal form. An IPv4 address is represented in dotted-decimal notation, with every eight bits (octet) represented by a number from 1 to 255, each separated by a dot. An example of an IPv4 address is 192.168.17.43.

IPv4 address contains two parts. The first part of the address specifies the network, and the second part specifies the host. A host represents a server offering resource information, services, and applications to users or other nodes on the network. It is a network that uses various protocols and attaches various hosts for their inter-communications.

IPv6 addresses

To avoid the address space issue in technology and to increase the address size from 32 bits in IPv4 to 128 bits, IPv6 specifies 3.4*1038 (2128) unique addresses. These are reportedly enough addresses, assigned one to every single host on the Internet. IPv6 addresses are shown in the form of eight sets of four hexadecimal digits, and each set of numbers separates by a colon. It looks like 2DAB:FFFF:0000:3EAE:01AA:00FF:DD72:2C4A. There are no defined classes in the IPv6 version.

Network devices

Repeater

A repeater is operated at the physical layer. It is used to regenerate the signal before it becomes too weak or corrupted so that the signal can be transmitted over the network. The repeaters do not amplify the signal. They put the signal bit by bit and regenerate it at the original strength when the signal becomes weak.

Cables

Computers are connected via cables to create a network. But sometimes individual computers and cables were not able to make a good system so to overcome this issue hubs came into existence. The cable is a media that transmits the communication signals.

There are three types of cables:

  • Twisted-pair cable: It is a high-speed cable that transmits the data over 1Gbps or more.
  • Coaxial cable: Coaxial cable resembles a TV installation cable. Coaxial cable is expensive than the twisted pair cable and provides a high data transmission speed.
  • Fiber optic cable: It is a high-speed cable that transmits the data using a light beam. It has a high data transmission speed as compared to other cables and more expensive as compared to other cables.

Hub

 A hub connects multiple cables coming from different branches. Hubs do not filter the data.  Data packets are sent to all connected devices. The collision domain of all hosts connected through Hub remains one. It does not have the intelligence to find out the best path for the data packets, which leads to inefficiencies and wastage. It is the way to interconnect LANs. The Hub amplifies the signal. If a device wants to communicate a message to many computers, it sends a message to the Hub. It is the responsibility of Hub to resend the message to all the computers. Hub can slow down if many computers try to send a message again and again at a time, which leads to confusing the hub.

Hub
  1. Hub works on the physical layer (Layer 1 of the OSI model).
  2. Hub works internally in bus topology.
  3. It has 2,4,8 ports to establish communication between the devices. They allow communication to a maximum of 8 devices.
  4. Hub is not an intelligent device. If computer1 wants to communicate with the computer2, routers transfer the message to all the computers attached to its ports.
  5. The message which is broadcasted contains the sender and receiver address. It can be read or modified by the others, but it is accepted by its respective receiver.
  6. Hub favors a single Collision domain that has a single way to communicate with other computers. If more than one computer sends its packets, they will collide among themselves.
  7. Hub can only be used in the LAN network.
  8. Hub does not have a table to store MAC address or IP address for the computers; that is why it broadcast the messages to all the computers.

There are two types of Hub:

  1. Active Hub-It acts as a Repeaters as it needs electricity to run. Still, it amplifies the analog signal or regenerates the digital signal so that the signal can be transferred over a long way.
  2. Passive Hub-It does not require electricity. It does not amplify the signal but only receive and forward the signal.

Bridges

A bridge is operated at the data link layer. A bridge functions as a repeater, with the functionality of filtering content by reading the MAC addresses of source and destination. It is used to interconnect two LANs working on the same protocol.

The bridges are full-fledged packet switches that forward and filter frames using the LAN destination addresses. When a frame reaches the bridge interface, the bridge does not copy the frame onto all of the other interfaces. The bridge specifies the destination address of the frame and attempts to forward the frame to the destination.

The bridge determines the 48-bit destination address for the packet and directs the packet only to the cable where the recipient resides. One packet causes less congestion, thereby. A bridge may store (buffer) enough bits to interpret the destination address. It could store (buffer) a whole packet and queue it for the correct outgoing link.

Bridges

Features:

  1. It is an intelligent device. Bridge inspect incoming traffic and decide whether to forward or reject.
  2. It checks the source and destination MAC address, not IP address as the IP address do not work on the datalink layer.
  3. The bridge is broadcasted to all devices at the first time, then it is broadcast to one of the segments of either side as it knows the MAC address of the device on its port.
  4. It is used to connect multiple network segments or LAN segment.
  5. It can filter data traffic.
  6. Bridges decrease the traffic on the LAN by dividing it into two segments.
  7. It has two collision Domains.

Switches

A switch is a networking device that works on the data link layer device. It makes efficient communication as it does not forward packets that have errors and forward good packets selectively to correct port only. A network switch is a device that is used to connect multiple computers inside LAN (Local Area Network). Network switches perform at the second layer (Data Link Layer) of the OSI model. The basic function of a Network switch is to forward layer 2 packets (Ethernet frames) from source device to destination device.

Switches

Features:

  1. It is an intelligent device and also works on the Data Link layer.
  2. The switch has multiple collision Domains, so there is less chance of collision of messages, among others.
  3. It has full-duplex communication.
  4. It maintains a CAM table based on the MAC address. It will communicate among all the devices on the basis of the CAM table.
  5. First, it will broadcasts then unicast and multicast.
  6. Every port of the switch is a separate collision domain.
  7. The switch has one Broadcasting domain.
  8. It has a maximum of 48 switch ports.
  9. It is slow as compared to others.

Types of switches

  1. Store and forward switch- The switch buffers and verify each frame before forwarding it. It is a little bit slow but very reliable.
  2. Cut through switch- The switch reads up to the frame hardware address before starting to forward it. No error checking.
  3. Fragment Free Switch- A method that attempts to retain the benefits of both store and forward and cut through check first 64 bytes.

Routers and Firewalls

Routers

A router relates to the network device that routes data packets based on their IP addresses. The router is mainly a Network Layer device. A Router connects WANs and LANs and has a dynamically updating routing table based on which they make decisions on routing the data packets. Routers are the first device in your network that gives you internet connectivity.

Routers

Features:

  1. It is the layer 3 device.
  2. It is a WAN device.
  3. The router is an internetworking device. It can communicate between two or more different networks.
  4. The router has a routing table and maintains Network ID and port number in its table. It communicates the messages based on its Network ID.
  5. It mostly uses WAN, not LAN.
  6. In the router, every port has its broadcast domain for broadcasting the messages.
  7. It has 2,4,8 ports.
  8. It is fast as compared to others.

Firewalls:

Firewalls

They can filter users and keep them out of private networks. Firewalls are network security appliances. Most of the small networks have perimeter-hardware firewalls, for controlling access and securing local networks from the outside world. Due to this reason, most perimeter firewalls also have routing capabilities.

The routers route traffic between two separate networks, firewalls monitor the traffic and block unauthorized traffic coming from the outside into your network. Few firewalls contain antivirus mechanisms to protect your network from viruses and unwanted emails.

There are many software firewall programs you can install on your computer, such as McAfee total protection, Norton antivirus, etc.

Gateway

A gateway is a connecting device used to connect remote networks with the host network. Generally, it acts as an entry or exit point. Mostly gateway is operated at the application layer.

A gateway is a way to connect two networks that may work upon different networking models. They work as a messenger agent that take data from one system, interpret it, and transfer it to another system. Gateways are also referred to as protocol converters and can operate at any network layer.

Uses of computer Network

  • Resource sharing

These are the resources that are shared, such as programs, printers, and data among the users on the network.

  • Server-client model

The computer networking is used in the server-client model. A server acts as a central computer, used to store the information, and maintained by the system administrator. Clients act as a machine used to access the information stored in the remote server.

  • Communication medium

The computer network offers the communication medium among the users.

  • e-commerce

The computer network is also important in businesses. We can perform business over the internet.



ADVERTISEMENT
ADVERTISEMENT