diff --git a/pydantic/errors.py b/pydantic/errors.py
--- a/pydantic/errors.py
+++ b/pydantic/errors.py
@@ -27,6 +27,7 @@
     'UrlUserInfoError',
     'UrlHostError',
     'UrlHostTldError',
+    'UrlPortError',
     'UrlExtraError',
     'EnumError',
     'IntegerError',
@@ -205,6 +206,11 @@ class UrlHostTldError(UrlError):
     msg_template = 'URL host invalid, top level domain required'
 
 
+class UrlPortError(UrlError):
+    code = 'url.port'
+    msg_template = 'URL port invalid, port cannot exceed 65535'
+
+
 class UrlExtraError(UrlError):
     code = 'url.extra'
     msg_template = 'URL invalid, extra characters found after valid URL: {extra!r}'
diff --git a/pydantic/networks.py b/pydantic/networks.py
--- a/pydantic/networks.py
+++ b/pydantic/networks.py
@@ -185,9 +185,14 @@ def validate(cls, value: Any, field: 'ModelField', config: 'BaseConfig') -> 'Any
         scheme = parts['scheme']
         if scheme is None:
             raise errors.UrlSchemeError()
+
         if cls.allowed_schemes and scheme.lower() not in cls.allowed_schemes:
             raise errors.UrlSchemePermittedError(cls.allowed_schemes)
 
+        port = parts['port']
+        if port is not None and int(port) > 65_535:
+            raise errors.UrlPortError()
+
         user = parts['user']
         if cls.user_required and user is None:
             raise errors.UrlUserInfoError()
@@ -205,7 +210,7 @@ def validate(cls, value: Any, field: 'ModelField', config: 'BaseConfig') -> 'Any
             host=host,
             tld=tld,
             host_type=host_type,
-            port=parts['port'],
+            port=port,
             path=parts['path'],
             query=parts['query'],
             fragment=parts['fragment'],

Is there a nice RFC explicitly stating a limit for port? If so I guess we could add a check, but this is not a bug, just a limit of the current validation.

You can implement a much cleaner validator:

```py
class Test(BaseModel):
    url: stricturl(allowed_schemes=['tcp'])

    @validator('url')
    def validate_port(cls, v):
        if int(v.port) > 2**16:
            raise ValueError('port overflow')
        return v
```
Hi,
[rfc 793](https://tools.ietf.org/html/rfc793#section-3.1) explain ports are 16 unsigned bits

Your validator will fail if port is missing, with tcp protocol that doesn't really make sense but with http(s) protocol is does:
example

`http://example.com` the validator will fail because v.port is None, int will raise a TypeError, but thanks for the tips I totally forgot port attribute 🤦


```py
class Test(BaseModel):
    url: stricturl(allowed_schemes=['tcp'])

    @validator('url')
    def validate_port(cls, v):
        if v.port is None:
            return v
        elif int(v.port) > 2**16:
            raise ValueError('port overflow')
        return v
```
(the tcp protocol is a bad showcase about default port)
Good point, `if v.port is not None and int(v.port) > 2**16` would be better. (is `port=0` allowed?)

> rfc 793 explain ports are 16 unsigned bits

PR welcome to add this check to all URL validation, I know technically it's a breaking chance, but I think a reasonable one, given that a higher port is invalid anyway.
the port 0 is tagged as reserved and should not be usable as such since most routers will reject it.
In a other hand in a lot of APIs port 0 mean "use the first avaiable socket" so I would say yes.

I'll work on a PR within a few days (this weekend I hope if I have time)
makes sense to allow 0, also makes the check easier.

> I'll work on a PR within a few days (this weekend I hope if I have time)

Thanks so much
I'm currently working on a PR,
looking at the sources of networks I have few questions about some design choices

Should I open news issues for each or asking here is fine ?

diff --git a/tests/test_networks.py b/tests/test_networks.py
--- a/tests/test_networks.py
+++ b/tests/test_networks.py
@@ -94,6 +94,7 @@ class Model(BaseModel):
             {'extra': ':db8::ff00:42:8329'},
         ),
         ('http://[192.168.1.1]:8329', 'value_error.url.host', 'URL host invalid', None),
+        ('http://example.com:99999', 'value_error.url.port', 'URL port invalid, port cannot exceed 65535', None),
     ],
 )
 def test_any_url_invalid(value, err_type, err_msg, err_ctx):

Url type port limit not checked
```
pydantic version: 1.5.1
pydantic compiled: False
install path: /opt/fastapi/backend/venv/lib/python3.8/site-packages/pydantic
python version: 3.8.3 (default, Jun 21 2020, 00:03:19)  [GCC 8.3.0]
platform: Linux-4.19.0-9-amd64-x86_64-with-glibc2.28
optional deps. installed: ['email-validator']
```

Hi,

The port limit is not checked by URLs types:

```py
>>> from pydantic import BaseModel, stricturl
>>> class Test(BaseModel):
	url: stricturl(allowed_schemes=["tcp"])

	
>>> Test(url="tcp://127.0.0.1:100000000000000000000000000000")
Test(url=UrlValue('tcp://127.0.0.1:100000000000000000000000000000', scheme='tcp', host='127.0.0.1', host_type='ipv4', port='100000000000000000000000000000'))
```
Excepted result: raise an error,

my current workaround
```py
>>> from pydantic import BaseModel, stricturl, validator
>>> from pydantic.networks import url_regex
>>> class Test(BaseModel):
	url: stricturl(allowed_schemes=["tcp"])
	@validator("url")
	def validate_port(cls, v):
		port = url_regex().match(v).group("port")
		if port is None:
		    return v

		if int(port) > 2**16:
			raise ValueError("port overflow")
		return v

	
>>> Test(url="tcp://127.0.0.1:900000")
Traceback (most recent call last):
  File "<pyshell#84>", line 1, in <module>
    Test(url="tcp://127.0.0.1:900000")
  File "pydantic\main.py", line 338, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Test
url
  port overflow (type=value_error)
```



tests/test_networks.py::test_any_url_invalid[http://example.com:99999-value_error.url.port-URL
tests/test_networks.py::test_any_url_success[http://example.org] tests/test_networks.py::test_any_url_success[http://test] tests/test_networks.py::test_any_url_success[http://localhost0] tests/test_networks.py::test_any_url_success[https://example.org/whatever/next/] tests/test_networks.py::test_any_url_success[postgres://user:pass@localhost:5432/app] tests/test_networks.py::test_any_url_success[postgres://just-user@localhost:5432/app] tests/test_networks.py::test_any_url_success[postgresql+psycopg2://postgres:postgres@localhost:5432/hatch] tests/test_networks.py::test_any_url_success[foo-bar://example.org] tests/test_networks.py::test_any_url_success[foo.bar://example.org] tests/test_networks.py::test_any_url_success[foo0bar://example.org] tests/test_networks.py::test_any_url_success[https://example.org] tests/test_networks.py::test_any_url_success[http://localhost1] tests/test_networks.py::test_any_url_success[http://localhost/] tests/test_networks.py::test_any_url_success[http://localhost:8000] tests/test_networks.py::test_any_url_success[http://localhost:8000/] tests/test_networks.py::test_any_url_success[https://foo_bar.example.com/] tests/test_networks.py::test_any_url_success[ftp://example.org] tests/test_networks.py::test_any_url_success[ftps://example.org] tests/test_networks.py::test_any_url_success[http://example.co.jp] tests/test_networks.py::test_any_url_success[http://www.example.com/a%C2%B1b] tests/test_networks.py::test_any_url_success[http://www.example.com/~username/] tests/test_networks.py::test_any_url_success[http://info.example.com?fred] tests/test_networks.py::test_any_url_success[http://info.example.com/?fred] tests/test_networks.py::test_any_url_success[http://xn--mgbh0fb.xn--kgbechtv/] tests/test_networks.py::test_any_url_success[http://example.com/blue/red%3Fand+green] tests/test_networks.py::test_any_url_success[http://www.example.com/?array%5Bkey%5D=value] tests/test_networks.py::test_any_url_success[http://xn--rsum-bpad.example.org/] tests/test_networks.py::test_any_url_success[http://123.45.67.8/] tests/test_networks.py::test_any_url_success[http://123.45.67.8:8329/] tests/test_networks.py::test_any_url_success[http://[2001:db8::ff00:42]:8329] tests/test_networks.py::test_any_url_success[http://[2001::1]:8329] tests/test_networks.py::test_any_url_success[http://[2001:db8::1]/] tests/test_networks.py::test_any_url_success[http://www.example.com:8000/foo] tests/test_networks.py::test_any_url_success[http://www.cwi.nl:80/%7Eguido/Python.html] tests/test_networks.py::test_any_url_success[https://www.python.org/\u043f\u0443\u0442\u044c] tests/test_networks.py::test_any_url_success[http://\u0430\u043d\u0434\u0440\u0435\u0439@example.com] tests/test_networks.py::test_any_url_success[https://example.com] tests/test_networks.py::test_any_url_success[https://exam_ple.com/] tests/test_networks.py::test_any_url_success[http://twitter.com/@handle/] tests/test_networks.py::test_any_url_invalid[http:///example.com/-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https:///example.com/-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://.example.com:8000/foo-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://example.org\\-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://exampl$e.org-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://??-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://.-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://..-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://example.org tests/test_networks.py::test_any_url_invalid[$https://example.org-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[../icons/logo.gif-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[abc-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[..-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[+http://example.com/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[ht*tp://example.com/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[ tests/test_networks.py::test_any_url_invalid[-value_error.any_str.min_length-ensure tests/test_networks.py::test_any_url_invalid[None-type_error.none.not_allowed-none tests/test_networks.py::test_any_url_invalid[http://2001:db8::ff00:42:8329-value_error.url.extra-URL tests/test_networks.py::test_any_url_invalid[http://[192.168.1.1]:8329-value_error.url.host-URL tests/test_networks.py::test_any_url_parts tests/test_networks.py::test_url_repr tests/test_networks.py::test_ipv4_port tests/test_networks.py::test_ipv6_port tests/test_networks.py::test_int_domain tests/test_networks.py::test_co_uk tests/test_networks.py::test_user_no_password tests/test_networks.py::test_at_in_path tests/test_networks.py::test_http_url_success[http://example.org] tests/test_networks.py::test_http_url_success[http://example.org/foobar] tests/test_networks.py::test_http_url_success[http://example.org.] tests/test_networks.py::test_http_url_success[http://example.org./foobar] tests/test_networks.py::test_http_url_success[HTTP://EXAMPLE.ORG] tests/test_networks.py::test_http_url_success[https://example.org] tests/test_networks.py::test_http_url_success[https://example.org?a=1&b=2] tests/test_networks.py::test_http_url_success[https://example.org#a=3;b=3] tests/test_networks.py::test_http_url_success[https://foo_bar.example.com/] tests/test_networks.py::test_http_url_success[https://exam_ple.com/] tests/test_networks.py::test_http_url_success[https://example.xn--p1ai] tests/test_networks.py::test_http_url_success[https://example.xn--vermgensberatung-pwb] tests/test_networks.py::test_http_url_success[https://example.xn--zfr164b] tests/test_networks.py::test_http_url_invalid[ftp://example.com/-value_error.url.scheme-URL tests/test_networks.py::test_http_url_invalid[http://foobar/-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[http://localhost/-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[https://example.123-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[https://example.ab123-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-value_error.any_str.max_length-ensure tests/test_networks.py::test_coerse_url[ tests/test_networks.py::test_coerse_url[https://www.example.com-https://www.example.com] tests/test_networks.py::test_coerse_url[https://www.\u0430\u0440\u0440\u04cf\u0435.com/-https://www.xn--80ak6aa92e.com/] tests/test_networks.py::test_coerse_url[https://exampl\xa3e.org-https://xn--example-gia.org] tests/test_networks.py::test_coerse_url[https://example.\u73e0\u5b9d-https://example.xn--pbt977c] tests/test_networks.py::test_coerse_url[https://example.verm\xf6gensberatung-https://example.xn--vermgensberatung-pwb] tests/test_networks.py::test_coerse_url[https://example.\u0440\u0444-https://example.xn--p1ai] tests/test_networks.py::test_coerse_url[https://exampl\xa3e.\u73e0\u5b9d-https://xn--example-gia.xn--pbt977c] tests/test_networks.py::test_parses_tld[ tests/test_networks.py::test_parses_tld[https://www.example.com-com] tests/test_networks.py::test_parses_tld[https://www.example.com?param=value-com] tests/test_networks.py::test_parses_tld[https://example.\u73e0\u5b9d-xn--pbt977c] tests/test_networks.py::test_parses_tld[https://exampl\xa3e.\u73e0\u5b9d-xn--pbt977c] tests/test_networks.py::test_parses_tld[https://example.verm\xf6gensberatung-xn--vermgensberatung-pwb] tests/test_networks.py::test_parses_tld[https://example.\u0440\u0444-xn--p1ai] tests/test_networks.py::test_parses_tld[https://example.\u0440\u0444?param=value-xn--p1ai] tests/test_networks.py::test_postgres_dsns tests/test_networks.py::test_redis_dsns tests/test_networks.py::test_custom_schemes tests/test_networks.py::test_build_url[kwargs0-ws://foo@example.net] tests/test_networks.py::test_build_url[kwargs1-ws://foo:x@example.net] tests/test_networks.py::test_build_url[kwargs2-ws://example.net?a=b#c=d] tests/test_networks.py::test_build_url[kwargs3-http://example.net:1234] tests/test_networks.py::test_son tests/test_networks.py::test_address_valid[foobar@example.com-foobar-foobar@example.com] tests/test_networks.py::test_address_valid[s@muelcolvin.com-s-s@muelcolvin.com] tests/test_networks.py::test_address_valid[Samuel tests/test_networks.py::test_address_valid[foobar tests/test_networks.py::test_address_valid[ tests/test_networks.py::test_address_valid[foo.bar@example.com tests/test_networks.py::test_address_valid[foo tests/test_networks.py::test_address_valid[FOO tests/test_networks.py::test_address_valid[<FOOBAR@example.com> tests/test_networks.py::test_address_valid[\xf1o\xf1\xf3@example.com-\xf1o\xf1\xf3-\xf1o\xf1\xf3@example.com] tests/test_networks.py::test_address_valid[\u6211\u8cb7@example.com-\u6211\u8cb7-\u6211\u8cb7@example.com] tests/test_networks.py::test_address_valid[\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com-\u7532\u6590\u9ed2\u5ddd\u65e5\u672c-\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com] tests/test_networks.py::test_address_valid[\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com-\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444-\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com] tests/test_networks.py::test_address_valid[\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld-\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937-\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld] tests/test_networks.py::test_address_valid[foo.bar@example.com-foo.bar-foo.bar@example.com] tests/test_networks.py::test_address_valid[foo.bar@exam-ple.com tests/test_networks.py::test_address_valid[\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr-\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2-\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr] tests/test_networks.py::test_address_invalid[f tests/test_networks.py::test_address_invalid[foo.bar@exam\nple.com tests/test_networks.py::test_address_invalid[foobar] tests/test_networks.py::test_address_invalid[foobar tests/test_networks.py::test_address_invalid[@example.com] tests/test_networks.py::test_address_invalid[foobar@.example.com] tests/test_networks.py::test_address_invalid[foobar@.com] tests/test_networks.py::test_address_invalid[foo tests/test_networks.py::test_address_invalid[foo@bar@example.com] tests/test_networks.py::test_address_invalid[\n@example.com] tests/test_networks.py::test_address_invalid[\r@example.com] tests/test_networks.py::test_address_invalid[\x0c@example.com] tests/test_networks.py::test_address_invalid[ tests/test_networks.py::test_address_invalid[\x1f@example.com] tests/test_networks.py::test_address_invalid["@example.com0] tests/test_networks.py::test_address_invalid["@example.com1] tests/test_networks.py::test_address_invalid[,@example.com] tests/test_networks.py::test_email_str tests/test_networks.py::test_name_email