473,748 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TCPClient comm with Telco Switch

I work for a telecom company.
We need to get data from our 5ESS switches to be consumed by a .NET app.
The data I am getting back is incomplete.
For example, the beginning of the first line recvd from the device should
read:
SWT5 5e16(2) 02.00

Instead I get
a bunch of gibberish then SWT5

The text greeting message that comes up above the login prompt
gets cut up (some chars are dropped) followed by a
(tab or LF) then the text greeting continues then cuts of a few chars again
followed by another (tab or LF), etc..

The login prompt should be:
login:

But instead I get:

a TAB char

or

TAB and n:

Like a lot of examples, I am using TCPClient, incoming data into a byte array
and displaying the string data in a textbox so I can see it.

Dim responseData As [String] = [String].Empty
data = New [Byte](2048) {}
Dim bytes As Int32 = st.Read(data, 0, data.Length)
responseData = System.Text.Enc oding.ASCII.Get String(data, 0, bytes)
txtRetVal.Text += responseData.To String

I have done this against UNIX applications in the past the same way without
issue.
Also, the switch will send some data, pause, then send more until I get the
results I am expecting.
It does not all happen at once. The login greeting/prompt will come in
thirds in a normal telnet session.
I cannot find any info anywhere that will help me here.
I thought maybe I needed term emulation but then I will get a large block of
the greeting message intact. If I needed emulation wouldn't it be consistant?
Thanks
Sep 23 '06 #1
8 1513
If it is any help,
I was able to connect using Hyperterminal ANSIW.
XP's Telnet does well until I enter my first password charactor to log in,
which I believe it sees as me submitting the password.

Thanks

"pickedanam e" wrote:
I work for a telecom company.
We need to get data from our 5ESS switches to be consumed by a .NET app.
The data I am getting back is incomplete.
For example, the beginning of the first line recvd from the device should
read:
SWT5 5e16(2) 02.00

Instead I get
a bunch of gibberish then SWT5

The text greeting message that comes up above the login prompt
gets cut up (some chars are dropped) followed by a
(tab or LF) then the text greeting continues then cuts of a few chars again
followed by another (tab or LF), etc..

The login prompt should be:
login:

But instead I get:

a TAB char

or

TAB and n:

Like a lot of examples, I am using TCPClient, incoming data into a byte array
and displaying the string data in a textbox so I can see it.

Dim responseData As [String] = [String].Empty
data = New [Byte](2048) {}
Dim bytes As Int32 = st.Read(data, 0, data.Length)
responseData = System.Text.Enc oding.ASCII.Get String(data, 0, bytes)
txtRetVal.Text += responseData.To String

I have done this against UNIX applications in the past the same way without
issue.
Also, the switch will send some data, pause, then send more until I get the
results I am expecting.
It does not all happen at once. The login greeting/prompt will come in
thirds in a normal telnet session.
I cannot find any info anywhere that will help me here.
I thought maybe I needed term emulation but then I will get a large block of
the greeting message intact. If I needed emulation wouldn't it be consistant?
Thanks
Sep 23 '06 #2
Hi,
My understanding of your issue is:
You used TCPClient to retrieve data from your switches; however you found
that the retrieved data was a bunch of gibberish, not as expected.
You could get the correct information on your UNIX applications.
If I have misunderstood, please let me know.

For further research, I would like to know:
1. Did you log on the switch first and then retrieve the data?
2. What was the encoding format when your UNIX applications logged on your
switch?
3. You couldn't use Telnet to retrieve data from switch due to logon
failure, right?
4. If your application uses ANSI (System.Text.En coding.Default) encoding,
what's the result?

Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Sep 25 '06 #3
Hi Charles,
What I am trying to do with the switch is establish a session, logon, run a
status on a telephone number, capture the results as string(which would
normally be displayed on a screen) and close the session. Once I have the
status in an object, I can parse through and consume this data in .NET.
When I try to connect via Hyperterminal using ANSIW encoding, it looks/works
fine.
When I change the properties of the hyperterminal connection to use just
ANSI encoding, that also works fine. If ANSI is the default encoding for TCP
connections in dot net, would setting the encoding make a difference, or is
none applied unless you specify?
Thanks,
-Lance R.
"Charles Wang[MSFT]" wrote:
Hi,
My understanding of your issue is:
You used TCPClient to retrieve data from your switches; however you found
that the retrieved data was a bunch of gibberish, not as expected.
You could get the correct information on your UNIX applications.
If I have misunderstood, please let me know.

For further research, I would like to know:
1. Did you log on the switch first and then retrieve the data?
2. What was the encoding format when your UNIX applications logged on your
switch?
3. You couldn't use Telnet to retrieve data from switch due to logon
failure, right?
4. If your application uses ANSI (System.Text.En coding.Default) encoding,
what's the result?

Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Sep 25 '06 #4
Dear Lance,
UTF-8 is the default encoding in .NET platform; the Default is the encoding
of system's current ANSI code page. TCPClient uses socket to send and
receive messages. It's a channel used to send stream with no default
encoding. The encoding depends on the messages. In other words, if the
server uses the ANSI/ANSIW encoding to encode and decode messages, the
client should explicitly specify ANSI as messages encoding when it sends or
receives messages.

So I recommend that you specify the ANSI encoding for sending and receiving
messages.

If you have any other questions, please feel free to let me know. It's my
pleasure to be of assistance.

Sincerely,
Charles Wang
Microsoft Online Community Support


Sep 26 '06 #5
Hi Charles, How do I specify this?

"Charles Wang[MSFT]" wrote:
Dear Lance,
UTF-8 is the default encoding in .NET platform; the Default is the encoding
of system's current ANSI code page. TCPClient uses socket to send and
receive messages. It's a channel used to send stream with no default
encoding. The encoding depends on the messages. In other words, if the
server uses the ANSI/ANSIW encoding to encode and decode messages, the
client should explicitly specify ANSI as messages encoding when it sends or
receives messages.

So I recommend that you specify the ANSI encoding for sending and receiving
messages.

If you have any other questions, please feel free to let me know. It's my
pleasure to be of assistance.

Sincerely,
Charles Wang
Microsoft Online Community Support


Sep 26 '06 #6
Dear Lance,
I'm sorry that I should provide an example for you in my previous reply.

Once you have used TCPClient to connect to the server.
You can send messages to server like:
Dim strMessage as String
strMessage="Hi Lance!"
client.Send(Sys tem.Text.Encodi ng.Default.GetB ytes(strMessage ));

You can receive messages like:
Dim buffer As Byte() = New Byte(1024) {}
Dim nRet As Integer = Me.client.Recei ve(buffer)
Me.txtRecv.Text = System.Text.Enc oding.Default.G etString(buffer )

If you have any other questions or concerns, please feel free to let me
know. It's my pleasure to be of assistance.

Sincerely,
Charles Wang
Microsoft Online Community Support


Sep 27 '06 #7
Hi Charles,
That's how I had it set up before. When I change the encoding to default, I
get the same results as before.
Any other ideas?
Thanks.

"Charles Wang[MSFT]" wrote:
Dear Lance,
I'm sorry that I should provide an example for you in my previous reply.

Once you have used TCPClient to connect to the server.
You can send messages to server like:
Dim strMessage as String
strMessage="Hi Lance!"
client.Send(Sys tem.Text.Encodi ng.Default.GetB ytes(strMessage ));

You can receive messages like:
Dim buffer As Byte() = New Byte(1024) {}
Dim nRet As Integer = Me.client.Recei ve(buffer)
Me.txtRecv.Text = System.Text.Enc oding.Default.G etString(buffer )

If you have any other questions or concerns, please feel free to let me
know. It's my pleasure to be of assistance.

Sincerely,
Charles Wang
Microsoft Online Community Support


Sep 27 '06 #8
Hi,
For troubleshooting this issue, I would like that:
1. If it's convenient for you, please mail me (ch******@micro soft.com) your
code snippet of the whole communication process.
2. You can use the monitor tool NetMon or Ethereal to monitor and compare
the data sent by Hyperterminal, telnet command and your application.

Sincerely,
Charles Wang
Microsoft Online Community Support

Sep 28 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1007
by: Andy Melton | last post by:
I am trying to find a Telco Database, written for mysql with a web front-end. We are trying to manage a telco switch and need to track things like ports, circuits, cards, etc. Has anyone seen/developed an open source database for a similar application. It would basically be a Metasolv alternative... Thx.
3
3049
by: מורדי | last post by:
Hi, I'm writing a client/server application in which the client send a series of screenshots to the server to be saved using the tcpclient. in most cases the first screenshot is transmitted ok and arrives at the server but from after that i only a couple of KB from the start of the file which cases the picture to display only the very top (of the screen). All the pictures are saved at the client side before sent to the server and they...
3
3968
by: al | last post by:
Hi, I am creating an application in access 97, so coding in vba. I am at the stage of sending values to my external machine, but am stuck at a point. I need to send each character at an interval of 0.1 seconds. So using the timer_event, i have set the timerinterval to 100.
3
2519
by: Adie | last post by:
I'm using TcpClient in blocking mode with NetworkStreams and would like to be able to give notification that data was sent - I presume this must be possible? But anyone know how?
3
28654
by: Ricardo Quintanilla | last post by:
i had a problem whom i do not know how to explain. i was using a TcpClient (System.Net.Sockets.TcpClient) object to send and receive data to an AS400 socket. Two months ago it started to work slowly, about 4 seconds between send and receive. In our production environment with hundreds of transactions it was truly costly. a while ago i changed de TcpClient object. Now i am using a Socket (System.Net.Sockets.Socket) object and it...
6
2873
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in the first seconds the communication is ok, later i receive read/write error. I?ve been in MSDN site and there i discover that the read/write error is a INVALID_HANDLE problem. But why??? I just create the serial communication file and use it....
1
4536
by: hamil | last post by:
I am having trouble using the TcpListener and TcpClient classes. At the end of this post is server code that runs, and a class whose purpose is described below. I need to know when the client closes the connection so I can exit my listener code. Here is what I have tried. First I asked MSDN and they said..
4
1511
by: J.C. | last post by:
So --my first VB program is to build a database of our large (1000+ networks) network. I would like to start by collecting all I can from our router configuration files. I can see that I can easly use TELNET from a Command window or TELNET:// in IE but I would think that I should be learning TCPClient. ( next have to read ATM switch configurations) Does anyone have some examples of a TcpClient session? any "WaitForString" methods?
2
4061
by: Tim Lambert | last post by:
Has anyone seen this happen? I have seen it on a system that is making lots and lots of short lived connections. At this point I'm not sure of the high water mark for the number of connections. Maybe I'm just running out of some kind of resource and the .NET framework is not doing a good job at reporting it. Any other ideas on what might cause it? Thanks. timXXXlambertXXX@mindspringXXX.com
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.