Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help to create a packet switching to create a destination files from an t

ID: 3677832 • Letter: I

Question

I need help to create a packet switching to create a destination files from an text that the user will enter text only once and it should leave a message for each destination file and I also need to create a main class which will read each file from the text I can either create a priority queue and ordered list to complete this problem I also need to create a lottoADT Class to solve this problem from the packet class and the main class will be the tester that will read the files from the lottoADT class which will be an interface class for the lottoADT and a packet class that will be the packet switching the description is below with the text file to be tested

The main advantage of packet-switching is that it permits a statistical sharing (multiplexing) of the communications lines. That is, the packets from many different sources can share a single line, allowing for very efficient use of the fixed capacity. With current technology, packets are generally accepted onto the network on a first-come, first-served basis. If the network becomes overloaded, packets are delayed or discarded (“dropped”). The receiving computer takes the packets (in whatever order they are received) and then “assembles” the original message. One might visualize the process as taking a bowl of scrambled eggs and trying to put each yoke back into their respective shells.

In this project we will simulate packet switching using what we have learned so far about lists and collections – reading a file of packets and reassembly to the appropriate destination files.

The following defines the scope of the problem you are to solve:

Your program will read asingle data file, the information contained within represents a stream of packets with an arbitrary number of destinations. In this simulation, a destination is file.

Because we are simulating a communications stream, you can only read the file once.

Each set of three (3) lines in the stream will represent a single packet.

The first line is the “destination” – the name of a file to which the assembled message is to be written.

The second line contains the index number of the next packet (beginning with 1) in the message or a value of 0 if it is thelast packet in the message.

The third line contains the text of the message. An empty line should be considered to be the same as a newline.

Once the packet stream (data file) has been completely exhausted, the messages for each “destination” should be saved to the appropriate “destination” file.

Keep in mind that an arbitrary number of messages can be sent to an arbitrary number of destinations in an arbitrary order and that packets can be lost.

By way of example consider the following stream of packets:

a.txt

2

bone technique for tod

b.txt

0

two classes

a.txt

3

ay's modern communic

b.txt

3

LottoADT and at least

a.txt

1

Packet switching is the back

a.txt

0

ation networks.

b.txt

2

consist of the Interface

b.txt

1

Your program should

One might be tempted to employ a queue, however, the output to a.txtwithout reassembly is “bone technique for today's modern communicPacket switching is the backation networks.”

The correctly assembled output to a.txt is “Packet switching is the backbone technique for today's modern communication networks.” And b.txt is “Your program should consist of the Interface LottoADT and at least two classes”.

Use the standard problem solving methodology that has been described. Examine the description and determine which ADT or combinations of ADTs would be most appropriate. As a start, you should develop a ‘Packet’ class. Test data will be provided.

Keep in mind that the order of packets in each destination file is according to packet number – 1, 2, 3, etc. – with 0 being the last one.

test data

a.txt
6

c.txt
40
The main advantage of packet-swi
c.txt
52
network on a first-come, first-
b.txt
28

b.txt
27
DESCRIPTION:
a.txt
17
and so dedicated can long endure
b.txt
26

a.txt
16
tion or any nation so conceived
a.txt
11
ed to the proposition that all m
a.txt
7
forth on this continent a new na
b.txt
34
icted lists, trees and hashing s
c.txt
50
With current technology, packets
b.txt
23
ing data structures, Addison-Wes
a.txt
9

a.txt
2

a.txt
10
conceived in liberty and dedicat
c.txt
54
omes overloaded, packets are del
b.txt
29
An introduction to the methods u
a.txt
0

c.txt
46
llowing for very efficient use o
c.txt
42
istical sharing (multiplexing) o
c.txt
57
packets (in whatever order recei
a.txt
14
Now we are engaged in a great ci
c.txt
49

a.txt
12
en are created equal.
c.txt
45
rent sources can share a line, a
a.txt
13

c.txt
51
are generally accepted onto the
b.txt
24
ley, ISBN 0-201-78878-0
a.txt
18
.
a.txt
15
vil war, testing whether that na
c.txt
44
is, the packets from many diffe
c.txt
58
ved) and “assembles” the origina
c.txt
55
ayed or discarded (“dropped”). T
b.txt
30
sed to store and access data eff
a.txt
1
THE GETTYSBURG ADDRESS
c.txt
43
f the communications lines. That
a.txt
4
Four score and seven years ago o
c.txt
41
tching is that it permits a stat
b.txt
36
topics of recursion and sorting
b.txt
22
ware Structures designing and us
b.txt
32
program performance, including
b.txt
25

b.txt
31
iciently, and their influence on
b.txt
33
linear lists, linked list, restr
b.txt
35
chemes. Included are the related
c.txt
56
he receiving computer takes the
c.txt
48

b.txt
37
algorithms and their influence
b.txt
21
Text: Lewis and Chase, Java Soft
b.txt
0

c.txt
47
f the fixed capacity.
a.txt
8
tion,
c.txt
53
served basis. If the network bec
c.txt
0

a.txt
3

a.txt
19

c.txt
59
l message.
a.txt
5
ur fathers brought
b.txt
38
on algorithm efficiency.

Please I need it quickly i have no idea on how to solve this problem and its due soon

Explanation / Answer

Basics:

Socket -- the communication object.

TCP properties: reliable, connection-oriented, byte-stream, connection established before application-level protocols exchange information, two-way communication.

UDP properties: unreliable, packet-switched, packet data, no connection overhead, application-level protocols exchange information immediately, two-way communication.

A socket connection is a 4-tuple -- (HostA, PortA, HostB, PortB) -- uniquely defining the connection.

UDP server code:

UDP client code:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote