FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Test-Connection Changes by vexx32 · Pull Request #172 · PowerShell/PowerShell-RFC · GitHub

Test-Connection Changes - #172

Merged
Joey Aiello (joeyaiello) merged 8 commits into
PowerShell:masterfrom
vexx32:patch-1
Jul 1, 2019
Merged

Test-Connection Changes#172
Joey Aiello (joeyaiello) merged 8 commits into
PowerShell:masterfrom
vexx32:patch-1

Conversation

Copy link
Copy Markdown
Contributor

Refer to PowerShell/PowerShell#6768 for existing discussion and Committee decision details.

Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
}

// For -MtuSizeDetect switch
class PingMtuDetect : PingStatus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Did you consider just having MtuSize being a member of PingStatus but $null if -DetectMtuSize is not specified?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We can do this, absolutely. However, that means that the default format view with the default behaviour will always have an empty column.

That strikes me as... Odd? Also, given the cmdlet's current behaviour with -MtuSizeDetect which causes the cmdlet to only send / retrieve a single PingReply (vs default behaviour W/O the switch being to send 4 pings instead) it seems a little better to have this as a separate object type imo.

Definitely open to alternate solutions though!

Steve Lee (SteveL-MSFT) May 24, 2019
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You've reminded me that Staffan Gustafsson (@powercode) has a PR to only show properties of MeasureInfo objects that have values. We can do the same thing here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you link me to that? I wasn't aware that the formatter supported this!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

PowerShell/PowerShell#7104, this was merged but was reverted

Rain Sallow (/u/ta11ow) (vexx32) May 28, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

So we'd need to put at least those methods into the code base for that to happen. Staffan Gustafsson (@powercode), would you be able to PR just those formatting methods in so that we can make use of them? I'm not familiar with why it was reverted, but I'm sure we could stand to use a feature like that in more places than just here. 🙂

EDIT: Seeing references to a security review. I guess that means we're waiting on a green light from... Paul Higinbotham (@PaulHigin)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Steve Lee (@SteveL-MSFT) I looked over these again -- I know you opened an issue for it in the PS repo -- and I realize we're going to hit an issue here; the reason this is fairly easily doable for MeasureInfo is that the format used is a List format, not a Table format. Implementing the same thing in a table format is... problematic at best.

Update RFC per Steve's comments
Update MtuSize property type & give default value
Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
This name conveys the same thing without being excessively long and causing difficulty effectively formatting the output.

Copy link
Copy Markdown
Contributor

I'm in general support barring the remainder of the discussion the formatting (which again, I think should be newlined for units and nothing else).

Rain Sallow (/u/ta11ow) (vexx32) commented Jun 19, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Steve Lee (@SteveL-MSFT) Joey Aiello (@joeyaiello) I was reading documentation for PingReply today... found this: https://docs.microsoft.com/en-us/dotnet/api/system.net.networkinformation.pingreply?view=netframework-4.8#remarks

Basically, when we're doing a traceroute (which essentially is done by sending out pings with TTL that increases one at a time so we can determine the hop points) we're always going to get back replies with a status of TtlExpired. This appears to be by design(?), and means that we're always going to have useless values for RoundtripTime, PingOptions, and Buffer.

I can work around this by:

  1. Using a Stopwatch to get reasonably accurate ping latency times.
  2. Explicitly passing in the PingOptions & buffer size values.

This shouldn't be hard to do, but I thought it should be noted. Not sure if it should be in the RFC text itself, let me know if I should add it.

This is why the current implementation can't get response times, etc., from the intermediary hops when doing a trace route -- so we have to basically fill in what we can by what we're sending as well as the directly measurable response time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pointing out a couple things I missed / typo'd in case folks want to comment on the individual items before I incorporate the edits.

Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated
Comment thread 1-Draft/RFCNNNN-Test-Connection.md Outdated

Copy link
Copy Markdown
Member

Rain Sallow (/u/ta11ow) (@vexx32) for the latency times, I think you can just send another ping to the destination along the route

Rain Sallow (/u/ta11ow) (vexx32) commented Jun 21, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Steve Lee (@SteveL-MSFT) yeah, I considered that... but then we're potentially sending double (or more if the timer ping happens to fail) the number of pings every single time, and that... doesn't seem like a good idea, really?

If I stopwatch.Start(); reply = pinger.Ping(); stopwatch.Stop() it should be sufficiently accurate, no?

Copy link
Copy Markdown
Contributor

No quorum today, but after applying your latest comments on missing a property or two, I'm personally good to merge.

Rain Sallow (/u/ta11ow) (vexx32) commented Jun 24, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Sounds good. I'll do a full review of this today or tomorrow. I've been exploring this in code to make sure the RFC makes sense practically and I think there are one or two other things that may need to be updated as well. (Especially regarding my comment that the table formatter can't really handle the variable number of properties as originally suggested.)

Copy link
Copy Markdown
Contributor Author

Joey Aiello (@joeyaiello) Steve Lee (@SteveL-MSFT) Updated the RFC & included some new examples based on my POC implementation I've been working on. 😄

Test-Connection [-TargetName] <string[]> [-IPv4] [-IPv6] [-ResolveDestination] [-TimeoutSeconds <int>] [-Quiet] [<CommonParameters>]

# Set 1
[-Ping] [-Count <int>] [-Delay <int>] [-Source <string>] [-MaxHops <int>] [-BufferSize <int>] [-DontFragment]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This would be the default parameter set, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yep!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i'm not sure why -tcpport is its own parameter set and why it can't just be part of all of the sets.

Copy link
Copy Markdown
Contributor

@PowerShell/powershell-committee voted and is ready to accept. James Truher (@JamesWTruher) had a question above, and I had one around whether -Source will actually work cross-platform (it's currently broken on Core), but we're comfortable handling both in code PR.

Rain Sallow (/u/ta11ow) (vexx32) commented Jul 1, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Sounds good. I have this all implemented in a branch, so I'll send a PR this evening :)

James Truher (@JamesWTruher) -TcpPort current implementation is -Quiet by default, with no other option available. I'm not familiar enough with the low level APIs to know whether ping packets sent to other ports make sense in a traceroute context or with determining MTU size?

bobfrankly commented Jul 2, 2019
edited
Loading

Copy link
Copy Markdown

I would like to see a sequence number added to the basic ping output. If you're testing on-prem targets that return consistent (like EXACTLY) stats, the sequence incrementing on the screen can be the difference between "is the ping still running? did the window freeze?" and "no, it's still running, see the sequence?"

Sequence numbers in the pings would also help with looking at the results from a long running ping test. When filtering the return from a long-running test, you could see if the missed pings are grouped or scattered by the sequence numbers.

Copy link
Copy Markdown
Contributor

Unless Rain Sallow (/u/ta11ow) (@vexx32) wants to implement that immediately, I think it's fine to take that up as an issue/PR in PowerShell/PowerShell later.

Copy link
Copy Markdown
Contributor Author

Joey Aiello (@joeyaiello) simple addition, I'm happy to. ^^

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL