Routing Within a Datagram Network

Moumita
Updated on 28-Nov-2020 08:15:34

2K+ Views

In packet switching networks using datagrams, datagrams are data packets which contain adequate header information so that they can be individually routed by all intermediate switching devices to the destination. These networks are called datagram networks since communication occurs via datagrams.Routing PrincipleIn datagram networks, each data packet is routed independently from the source to the destination even if they belong to the same message. No prior resource or channel allocation is done for the individual packets. As the datagrams are treated as independent units, no dedicated path is fixed for data transfer. Each datagram is routed by the intermediate routers ... Read More

Store and Forward Packet Switching

Moumita
Updated on 28-Nov-2020 08:14:15

18K+ Views

In telecommunications, store − and − forward packet switching is a technique where the data packets are stored in each intermediate node, before they are forwarded to the next node. The intermediate node checks whether the packet is error−free before transmitting, thus ensuring integrity of the data packets. In general, the network layer operates in an environment that uses store and forward packet switching.Working PrincipleThe node which has a packet to send, delivers it to the nearest node, i.e. router. The packet is stored in the router until it has fully arrived and its checksum is verified for error detection. ... Read More

Network Layer Design Issues

Moumita
Updated on 28-Nov-2020 08:12:16

50K+ Views

The network layer or layer 3 of the OSI (Open Systems Interconnection) model is concerned delivery of data packets from the source to the destination across multiple hops or links. It is the lowest layer that is concerned with end − to − end transmission. The designers who are concerned with designing this layer needs to cater to certain issues. These issues encompasses the services provided to the upper layers as well as internal design of the layer.The design issues can be elaborated under four heads −Store − and − Forward Packet SwitchingServices to Transport LayerProviding Connection Oriented ServiceProviding Connectionless ... Read More

Functions of the Network Layer

Moumita
Updated on 28-Nov-2020 08:11:25

21K+ Views

The main function of the network layer or layer 3 of the OSI (Open Systems Interconnection) model is delivery of data packets from the source to the destination across multiple hops or links. It also controls the operation of the subnet.The functions are elaborated as below −When data is to be sent, the network layer accepts data from the transport layer above, divides and encapsulates it into packets and sends it to the data link layer. The reverse procedure is done during receiving data.The network layer is responsible for routing packets from the source host to the destination host. The ... Read More

The Computer Network Layer

Moumita
Updated on 28-Nov-2020 08:11:02

1K+ Views

The network layer or Layer 3 of the OSI (Open Systems Interconnection) model is responsible for the source to destination delivery of data packets across multiple hops or nodes. It controls the operation of the subnet.The position of the network layer in the OSI model is depicted in the following diagram −Functions of the Network LayerThe network layer is responsible for routing packets from the source host to the destination host. The routes can be based upon static tables that are rarely changed; or they can be automatically updated depending upon network conditions.Many networks are partitioned into sub-networks or subnets. ... Read More

Convert String to Zigzag String of Line Count K in Python

Arnab Chakraborty
Updated on 26-Nov-2020 08:34:06

364 Views

Suppose we have a string s and another value k, We have to find a new string by taking each character from s and starting diagonally from top left to bottom right until reaching the kth line, then go up to top right, and so on.So, if the input is like s = "ilovepythonprogramming" k = 5, then the output will beTo solve this, we will follow these steps:line := a new mapcnt := 0delta := 1for each index i and character c in s, doinsert (c, i) at the end of line[cnt]cnt := cnt + deltaif cnt is same ... Read More

Length of Longest Alternating Path in a Binary Tree using Python

Arnab Chakraborty
Updated on 26-Nov-2020 08:30:08

278 Views

Suppose we have a binary tree, we have to find the longest path that alternates between left and right child and going down.So, if the input is likethen the output will be 5 as the alternating path is [2, 4, 5, 7, 8].To solve this, we will follow these steps:if root is null, thenreturn 0Define a function dfs() . This will take node, count, flagif node is not null, thenif flag is same as True, thena := dfs(left of node, count + 1, False)b := dfs(right of node, 1, True)otherwise when flag is same as False, thena := dfs(right of ... Read More

Find Length of Longest Word Formed from Given Letters in Python

Arnab Chakraborty
Updated on 26-Nov-2020 08:27:28

333 Views

Suppose we have a list of words and a string called letters, we have to find the size of the longest word that can be made by rearranging the given letters. In the letters there may be asterisk character (*) it can match any character. And it is not necessary to use all the letters.So, if the input is like words = ["prince", "rice", "price", "limit", "hello"] letters = "*r**ce*", then the output will be 6, as the longest word we can make is "prince" the length is 6.To solve this, we will follow these steps:has := a map containing ... Read More

Count Number of Word Concatenations in a List in Python

Arnab Chakraborty
Updated on 26-Nov-2020 08:25:59

189 Views

Suppose we have a list of strings; we have to find the number of words that are concatenations of other words also in the list. We can reuse words when concatenating and concatenate any number of times.So, if the input is like words = ["hello", "world", "helloworld", "famous", "worldfamous", "programming"], then the output will be 2, as "helloworld" is concatenation of "hello" and "world". "worldfamous" is concatenation of "world" and "famous".To solve this, we will follow these steps:trie := a new mapfor each word in words, dolayer := triefor each w in word, doif w is not in layer, thenlayer[w] ... Read More

Find Nearest Time by Reusing Same Digits in Python

Arnab Chakraborty
Updated on 26-Nov-2020 08:22:21

348 Views

Suppose we have a 24-hour string in "hh:mm" format, we have to find the next closest time that can be formed by reusing given digits. We can reuse digits from the given string as many times as we want.So, if the input is like s = "03:15", then the output will be 03:30, as the nearest time 03:30 that repeats the given digits.To solve this, we will follow these steps:use := a list with two digit hour and two digit mins valuespossible := a new setDefine a function backtrack() . This will take pathif size of path is same as ... Read More

Advertisements