Answer:
The UDP server described needed only one socket, whereas the TCP server needed two sockets because:
Answer:
UDP uses one socket and TCP requires two sockets in a transmission because UDP is a way one connectionless protocol but TCP is connection oriented.
The TCP server that supports n simultaneous connections would require n sockets, ranging from 1 through n.
Explanation:
A socket is a fusion of a port number and a source IP address using a colon.
UDP is a transport layer protocol that is unreliable, because it does not need to establish connection to transmit packets and does not retransmit dropped packets. TCP is another transport layer protocol that is reliable, establish connection and retransmit dropped packets.
For a UDP, only one socket would be created to transmission. A socket on the client side and server side would be created in TCP connection. A server can have multiple sockets for one or different transmission protocols.
Answer:
885 μs
Explanation:
Given that:
Switch via = 100 Mbps links
The propagation delay for each link = 25μs.
Retransmitting a received packet = 35μs
To determine:
The total time required to transmit 40,000 bits from A to B.
Considering the fact as a single packet:
Transmit Delay / link = size/bandwith
= 4×10⁴ bits / 100 × 10⁶ bits/sec
= 400 μs
The total transmission time = ( 2 × 400 + 2 × 25 + 35) μs
= (800 + 50 + 35) μs
= 885 μs
Answer:
I am writing a Python program:
def string_finder(target,search): #function that takes two parameters i.e. target string and a search string
position=(target.find(search))# returns lowest index of search if it is found in target string
if position==0: # if value of position is 0 means lowers index
return "Beginning" #the search string in the beginning of target string
elif position== len(target) - len(search): #if position is equal to the difference between lengths of the target and search strings
return "End" # returns end
elif position > 0 and position < len(target) -1: #if value of position is greater than 0 and it is less than length of target -1
return "Middle" #returns middle
else: #if none of above conditions is true return not found
return "not found"
#you can add an elif condition instead of else for not found condition as:
#elif position==-1
#returns "not found"
#tests the data for the following cases
print(string_finder("Georgia Tech", "Georgia"))
print(string_finder("Georgia Tech", "gia"))
print(string_finder("Georgia Tech", "Tech"))
print(string_finder("Georgia Tech", "Idaho"))
Explanation:
The program can also be written in by using string methods.
def string_finder(target,search): #method definition that takes target string and string to be searched
if target.startswith(search): #startswith() method scans the target string and checks if the (substring) search is present at the start of target string
return "Beginning" #if above condition it true return Beginning
elif target.endswith(search): #endswith() method scans the target string and checks if the (substring) search is present at the end of target string
return "End"#if above elif condition it true return End
elif target.find(search) != -1: #find method returns -1 if the search string is not in target string so if find method does not return -1 then it means that the search string is within the target string and two above conditions evaluated to false so search string must be in the middle of target string
return "Middle" #if above elif condition it true return End
else: #if none of the above conditions is true then returns Not Found
return "Not Found"
Answer:
shortNames = ['Gus', 'Bob','Zoe']
Explanation:
In this assignment, your knowledge of list is been tested. A list is data structure type in python that can hold different elements (items) of different type. The general syntax of a list is
listName = [item1, "item2", item3]
listName refers to the name of the list variable, this is followed by a pair of square brackets, inside the square brackets we have items separated by commas. This is a declaration and initialization of a list with some elements.
The complete python code snippet for this assignment is given below:
shortNames = ['Gus', 'Bob','Zoe']
print(shortNames[0])
print(shortNames[1])
print(shortNames[2])
Enter number: 10
Wrong credentials
Enter password: tomato
Enter number: 1847
Wrong credentials
Enter password: milkyway
Enter number: 1847
Access Granted
Answer:
// Program is written in Java Programming Language
// Comments are used for explanatory purpose
// Program starts here
import java.util.Scanner;
public class checkPass{
public static void main (String [] args)
{
// Call scanner function
Scanner input = new Scanner (System.in);
// Declare user password and number
string userpass;
int usernum;
// Initialise password and number
string password = "milkway";
int number = 1847;
// Initialise number of attempts to 0
int attempts = 0;
while (attempts<=10 )
{
// Prompt user to enter password and number
System.out.println("Enter password: ");
userpass = input.nextLine();
System.out.println("Enter Number: ");
usernum = input.nextInt();
if(userpass == password && usernum == number)
{
System.out.print("Access Granted");
attempts = 11;
}
else
{
System.out.print("Wrong Credentials");
attempts++;
}
}
}
}
Explanation:
The correct password and number are defined and stored in their respective variables. While loop is used to keep on taking input from the user until the user inputs correct password and number or user runs out of attempts. The number of attempts is set to 3 but can be changed to any number as you like.
The user is asked to input password first then we check if the user wants to quit? if true terminate program else continue to get the input number from the user.
Now we have password and number from the user, check if both are correct? if yes then grant the access else wrong credentials add one to the attempt, display the number of attempts left and repeat the whole loop again.
Python Code:
password = "milkyway"
number = 1847
attempts=0
while attempts < 3:
pas=str(input("Please Enter the Password\n"))
if pas=="quit":
print("You quit!")
break
num=int(input("Please Enter the Number\n"))
if pas==password and num==number:
print("Access Granted")
else:
print("Wrong credentials")
attempts+=1
print("Attempts left: ",3-attempts)
Output:
Test 1:
Please Enter the Password
waysnf
Please Enter the Number
1847
Wrong credentials
Attempts left: 2
Please Enter the Password
milkyway
Please Enter the Number
1942
Wrong credentials
Attempts left: 1
Please Enter the Password
milkyway
Please Enter the Number
1847
Access Granted
Test 2:
Please Enter the Password
menas
Please Enter the Number
4235
Wrong credentials
Attempts left: 2
Please Enter the Password
quit
You quit!
Note: feel free to ask in comments if you dont understand anything!
The best method in network security to prevent intrusion are:
In the above case, the things to do is that one needs to focus on these areas for a a good network design. They are:
Therefore, The best method in network security to prevent intrusion are:
Learn more about network security from
#SPJ6
Answer:
There are many benefits to be gained from network segmentation, of which security is one of the most important. Having a totally flat and open network is a major risk. Network segmentation improves security by limiting access to resources to specific groups of individuals within the organization and makes unauthorized access more difficult. In the event of a system compromise, an attacker or unauthorized individual would only have access to resources on the same subnet. If access to certain databases in the data center must be given to a third party, by segmenting the network you can easily limit the resources that can be accessed, it also provides greater security against internal threats.
Explanation:
Answer:
The answer is True